From patchwork Fri Mar 2 18:59:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 130572 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1601097lja; Fri, 2 Mar 2018 11:00:06 -0800 (PST) X-Google-Smtp-Source: AG47ELtMOpbJzq8FeIVBz9hUrGiHU02R0eOW+xqUOBwxtV562qM4L0fPfOpcWqynGZ9trEZ3EClY X-Received: by 10.99.176.15 with SMTP id h15mr5269454pgf.448.1520017206475; Fri, 02 Mar 2018 11:00:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520017206; cv=none; d=google.com; s=arc-20160816; b=pdXjeqspolpEvkaKKTwUdo278Q5wv4FglfsSlENl1uv3JqBb3y60wgmrNxM87plObV SoCMnQswYnRKFg5wlTEZFV9InE4dxbLlagiHWmaS4I1ORkPyV9zWACYb+gbMn/9uJ0na 93Cfqb2T12atdwEA49zQjdSTXMNOekEt7ZYFhODN7KmMDLHVhUT/Aq4A56XFS0FglVI2 9EGuiuBH6rE8/j57TzOFrJuvPcNcLlEh9F5py0pevJpobK6+sxIGYRwZz3hJkuO59Gha /usIA6tOZMuWDBVkHugifWwOos0gV1fCi2Ry+1vVDs7wnDfo9+2z6EPxiLWeunCnCe33 q56A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=QlqhES6zlAD/tWiBBm5yvRtAQo1H1CCf7mGDalppfjY=; b=LQQ+C7cwLZrBKi2RJ0+pRrqMlIe11soVEM13HoY2IRBgzYXTuzWGFHHor5hrRQD26P +r5SQzvG5oidAWCQpIB3zVoOUYUK5oy8yT8iHXm8jiodtea6ooTu5Vu3A86kG89R8uOI Z/RJp1YY3tKnIcTR2t9ggUy8ZlcrvjF5z/ElelyMkhSn+G4ASosXQIIAZ1QqkYiC99bh IMJJUysc+CBY2pk8W90RiRl8zfG2K5UrUrHiivv7lik4c07w9oy+DGINrkY84P8iSMC0 tUYlyX/v3MHR7ALClDlsFP4ySvyU1Vzm+dnjPBsM3hAggDKfIy7jN82RvYH4fKy/0VAD NieA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Wu3tBXSw; spf=pass (google.com: domain of libc-alpha-return-90738-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-90738-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id k3si5332492pfj.24.2018.03.02.11.00.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Mar 2018 11:00:06 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-90738-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Wu3tBXSw; spf=pass (google.com: domain of libc-alpha-return-90738-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-90738-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=iDgX82f2Nqwi225QHyL5ZSNWGqflMEY tdHdQvUSfHgLLnR0NnaDwXe3DQm1ZqvMQYpmB3pHuJLYr38AulGxRAhBNTC0CiN2 iH+yjOysJBoccsdVtHNQRCcxlJ4usirFUbs7lG8RKOPdy/bCn8bG2LCziATrLHt0 XDcABQrfqJBk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=v4s4Jrc6tVW8oiz3vVsNdUhqixw=; b=Wu3tB XSwFjQ5TijbUVadxEcegTuRRed36Wtg8Zv+zWOg8OrO7KO5p9MfBDwsiQfPXVtyK GEdxfuvr33sQPztmpNk7XeLZ8Yp/MDY2Lj2kYy1+7T4m35qqEdbeMMg4i+smUsNc sJONoi0Ha0hH7gNMDb0Tr6pIUJQLuvt8VFef4U= Received: (qmail 97264 invoked by alias); 2 Mar 2018 18:59:42 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 97127 invoked by uid 89); 2 Mar 2018 18:59:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Consolidate X-HELO: mail-qk0-f193.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=QlqhES6zlAD/tWiBBm5yvRtAQo1H1CCf7mGDalppfjY=; b=OvLaXra0Jnp6TGRdFIcI1lG3ypByToiWRZK2RXzfLFdhi2tBBku8QMB5DpRGIIS/zi vzQkeHXapmz2uEl1YFe0auG9/8SSi26FbZAOdjc5xdmqzlH49ApypV65UhieT+K/E9qy L3XBLM0V8AdrqoGF+zGLUNbuyAuZkSD2luQaB8LID6bdohunHSXClFG7xP+2YAy/b2vD DkmKLQFmqBY2mot25xSC6u+Kv6Xa/JFEtlcd2ROrwZAZHHfSKZx6tNPpMGFreCYuZhcb sWhltV2W4K5yEth6SvmkSokOJR++CJ7k+k9o8UOCsXZTJoKTFI0z80TTHKWnhmlCeKIv V76g== X-Gm-Message-State: APf1xPCka1mjVJmUwRmTM/awThDuhRqDFKozfa82sbkbtr9IsAGtpl96 W2u/A9LuwifQe+4kh9sxhA9fC5ZCV6o= X-Received: by 10.55.123.5 with SMTP id w5mr9668190qkc.261.1520017174651; Fri, 02 Mar 2018 10:59:34 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 3/7] Consolidate Linux readdir{64}{_r} implementation Date: Fri, 2 Mar 2018 15:59:21 -0300 Message-Id: <1520017165-15830-3-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1520017165-15830-1-git-send-email-adhemerval.zanella@linaro.org> References: <1520017165-15830-1-git-send-email-adhemerval.zanella@linaro.org> This patch consolidates Linux readdir{64}{_r} implementation on just the default sysdeps/unix/sysv/linux/readdir{64}{_r}.c ones. The default implementation handle the Linux requirements: * readdir{_r} is only built for _DIRENT_MATCHES_DIRENT64 being 0. * readdir64{_r} is always built and aliased to readdir{_r} for ABI that define _DIRENT_MATCHES_DIRENT64. * A compat symbol is added for readdir64{_r} for ABI that used to export the old non-LFS version. Checked on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu, sparcv9-linux-gnu, sparc64-linux-gnu, powerpc-linux-gnu, and powerpc64le-linux-gnu. * sysdeps/posix/readdir.c (__READDIR, __GETDENTS, DIRENTY_TYPE, __READDIR_ALIAS): Undefine after usage. * sysdeps/posix/readdir_r.c (__READDIR_R, __GETDENTS, DIRENT_TYPE, __READDIR_R_ALIAS): Likewise. * sysdeps/unix/sysv/linux/arm/readdir64.c: Remove file. * sysdeps/unix/sysv/linux/arm/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/m68k/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/m68k/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/i386/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/i386/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/readdir.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/readdir64.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/readdir64_r.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c: Likewise. * sysdeps/unix/sysv/linux/readdir.c: New file. * sysdeps/unix/sysv/linux/readdir_r.c: Likewise. * sysdeps/unix/sysv/linux/readdir64.c: Add compat symbol if required. * sysdeps/unix/sysv/linux/readdir64_r.c: Likewise. --- ChangeLog | 25 +++++++++++ sysdeps/posix/readdir.c | 5 +++ sysdeps/posix/readdir_r.c | 5 +++ sysdeps/unix/sysv/linux/arm/readdir64.c | 1 - sysdeps/unix/sysv/linux/arm/readdir64_r.c | 1 - sysdeps/unix/sysv/linux/m68k/readdir64.c | 1 - sysdeps/unix/sysv/linux/m68k/readdir64_r.c | 1 - sysdeps/unix/sysv/linux/powerpc/readdir64.c | 1 - sysdeps/unix/sysv/linux/powerpc/readdir64_r.c | 1 - .../sysv/linux/{i386/readdir64_r.c => readdir.c} | 30 +++---------- sysdeps/unix/sysv/linux/readdir64.c | 51 +++++++++++++++++++++- sysdeps/unix/sysv/linux/readdir64_r.c | 48 +++++++++++++++++++- .../sysv/linux/{i386/readdir64.c => readdir_r.c} | 33 +++----------- sysdeps/unix/sysv/linux/s390/s390-32/readdir64.c | 1 - sysdeps/unix/sysv/linux/s390/s390-32/readdir64_r.c | 1 - sysdeps/unix/sysv/linux/sparc/sparc32/readdir64.c | 1 - .../unix/sysv/linux/sparc/sparc32/readdir64_r.c | 1 - sysdeps/unix/sysv/linux/wordsize-64/readdir.c | 8 ---- sysdeps/unix/sysv/linux/wordsize-64/readdir64.c | 1 - sysdeps/unix/sysv/linux/wordsize-64/readdir64_r.c | 1 - sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c | 4 -- 21 files changed, 141 insertions(+), 80 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/arm/readdir64.c delete mode 100644 sysdeps/unix/sysv/linux/arm/readdir64_r.c delete mode 100644 sysdeps/unix/sysv/linux/m68k/readdir64.c delete mode 100644 sysdeps/unix/sysv/linux/m68k/readdir64_r.c delete mode 100644 sysdeps/unix/sysv/linux/powerpc/readdir64.c delete mode 100644 sysdeps/unix/sysv/linux/powerpc/readdir64_r.c rename sysdeps/unix/sysv/linux/{i386/readdir64_r.c => readdir.c} (52%) rename sysdeps/unix/sysv/linux/{i386/readdir64.c => readdir_r.c} (51%) delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/readdir64.c delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/readdir64_r.c delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/readdir64.c delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/readdir64_r.c delete mode 100644 sysdeps/unix/sysv/linux/wordsize-64/readdir.c delete mode 100644 sysdeps/unix/sysv/linux/wordsize-64/readdir64.c delete mode 100644 sysdeps/unix/sysv/linux/wordsize-64/readdir64_r.c delete mode 100644 sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c -- 2.7.4 diff --git a/sysdeps/posix/readdir.c b/sysdeps/posix/readdir.c index fcd3853..a6ecc0f 100644 --- a/sysdeps/posix/readdir.c +++ b/sysdeps/posix/readdir.c @@ -120,3 +120,8 @@ __READDIR (DIR *dirp) #ifdef __READDIR_ALIAS weak_alias (__readdir, readdir) #endif + +#undef __READDIR +#undef __GETDENTS +#undef DIRENT_TYPE +#undef __READDIR_ALIAS diff --git a/sysdeps/posix/readdir_r.c b/sysdeps/posix/readdir_r.c index 79030ab..2d691e7 100644 --- a/sysdeps/posix/readdir_r.c +++ b/sysdeps/posix/readdir_r.c @@ -152,3 +152,8 @@ __READDIR_R (DIR *dirp, DIRENT_TYPE *entry, DIRENT_TYPE **result) #ifdef __READDIR_R_ALIAS weak_alias (__readdir_r, readdir_r) #endif + +#undef __READDIR_R +#undef __GETDENTS +#undef DIRENT_TYPE +#undef __READDIR_R_ALIAS diff --git a/sysdeps/unix/sysv/linux/arm/readdir64.c b/sysdeps/unix/sysv/linux/arm/readdir64.c deleted file mode 100644 index 2ea26dd..0000000 --- a/sysdeps/unix/sysv/linux/arm/readdir64.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/arm/readdir64_r.c b/sysdeps/unix/sysv/linux/arm/readdir64_r.c deleted file mode 100644 index 9f54f89..0000000 --- a/sysdeps/unix/sysv/linux/arm/readdir64_r.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/m68k/readdir64.c b/sysdeps/unix/sysv/linux/m68k/readdir64.c deleted file mode 100644 index 2ea26dd..0000000 --- a/sysdeps/unix/sysv/linux/m68k/readdir64.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/m68k/readdir64_r.c b/sysdeps/unix/sysv/linux/m68k/readdir64_r.c deleted file mode 100644 index 9f54f89..0000000 --- a/sysdeps/unix/sysv/linux/m68k/readdir64_r.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/powerpc/readdir64.c b/sysdeps/unix/sysv/linux/powerpc/readdir64.c deleted file mode 100644 index 2ea26dd..0000000 --- a/sysdeps/unix/sysv/linux/powerpc/readdir64.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/powerpc/readdir64_r.c b/sysdeps/unix/sysv/linux/powerpc/readdir64_r.c deleted file mode 100644 index 9f54f89..0000000 --- a/sysdeps/unix/sysv/linux/powerpc/readdir64_r.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/i386/readdir64_r.c b/sysdeps/unix/sysv/linux/readdir.c similarity index 52% rename from sysdeps/unix/sysv/linux/i386/readdir64_r.c rename to sysdeps/unix/sysv/linux/readdir.c index 31862a0..b99bc96 100644 --- a/sysdeps/unix/sysv/linux/i386/readdir64_r.c +++ b/sysdeps/unix/sysv/linux/readdir.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2000-2018 Free Software Foundation, Inc. +/* Read a directory. Linux no-LFS version. + Copyright (C) 2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,29 +16,8 @@ License along with the GNU C Library; if not, see . */ -#define __READDIR_R __readdir64_r -#define __GETDENTS __getdents64 -#define DIRENT_TYPE struct dirent64 +#include -#include - -#undef __READDIR_R -#undef __GETDENTS -#undef DIRENT_TYPE - -#include - -versioned_symbol (libc, __readdir64_r, readdir64_r, GLIBC_2_2); - -#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) - -#include - -#define __READDIR_R attribute_compat_text_section __old_readdir64_r -#define __GETDENTS __old_getdents64 -#define DIRENT_TYPE struct __old_dirent64 - -#include - -compat_symbol (libc, __old_readdir64_r, readdir64_r, GLIBC_2_1); +#if !_DIRENT_MATCHES_DIRENT64 +# include #endif diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c index 6d154fe..054e4ff 100644 --- a/sysdeps/unix/sysv/linux/readdir64.c +++ b/sysdeps/unix/sysv/linux/readdir64.c @@ -1,8 +1,55 @@ -#define __READDIR __readdir64 -#define __GETDENTS __getdents64 +/* Read a directory. Linux LFS version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* When _DIRENT_MATCHES_DIRENT64 is defined we can alias 'readdir64' to + 'readdir'. However the function signatures are not equal due + different return types, so we need to suppress {__}readdir so weak + and strong alias do not throw conflicting types errors. */ +#define readdir __no_readdir_decl +#define __readdir __no___readdir_decl +#include + +#define __READDIR __readdir64 +#define __GETDENTS __getdents64 #define DIRENT_TYPE struct dirent64 #include +#undef __readdir +#undef readdir + libc_hidden_def (__readdir64) +#if _DIRENT_MATCHES_DIRENT64 +strong_alias (__readdir64, __readdir) weak_alias (__readdir64, readdir64) +weak_alias (__readdir64, readdir) +#else +/* The compat code expects the 'struct direct' with d_ino being a __ino_t + instead of __ino64_t. */ +# include +versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2); +# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) +# include +# define __READDIR attribute_compat_text_section __old_readdir64 +# define __GETDENTS __old_getdents64 +# define DIRENT_TYPE struct __old_dirent64 +# include +libc_hidden_def (__old_readdir64) +compat_symbol (libc, __old_readdir64, readdir64, GLIBC_2_1); +# endif /* SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) */ +#endif /* _DIRENT_MATCHES_DIRENT64 */ diff --git a/sysdeps/unix/sysv/linux/readdir64_r.c b/sysdeps/unix/sysv/linux/readdir64_r.c index 3dfbf4f..22b23d5 100644 --- a/sysdeps/unix/sysv/linux/readdir64_r.c +++ b/sysdeps/unix/sysv/linux/readdir64_r.c @@ -1,7 +1,53 @@ +/* Read a directory in reentrant mode. Linux LFS version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* When _DIRENT_MATCHES_DIRENT64 is defined we can alias 'readdir64' to + 'readdir'. However the function signatures are not equal due + different return types, so we need to suppress {__}readdir so weak + and strong alias do not throw conflicting types errors. */ +#define readdir_r __no_readdir_r_decl +#define __readdir_r __no___readdir_r_decl +#include + #define __READDIR_R __readdir64_r -#define __GETDENTS __getdents64 +#define __GETDENTS __getdents64 #define DIRENT_TYPE struct dirent64 #include +#undef __readdir_r +#undef readdir_r + +#if _DIRENT_MATCHES_DIRENT64 +strong_alias (__readdir64_r, __readdir_r) +weak_alias (__readdir64_r, readdir_r) weak_alias (__readdir64_r, readdir64_r) +#else +/* The compat code expects the 'struct direct' with d_ino being a __ino_t + instead of __ino64_t. */ +# include +versioned_symbol (libc, __readdir64_r, readdir64_r, GLIBC_2_2); +# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) +# include +# define __READDIR_R attribute_compat_text_section __old_readdir64_r +# define __GETDENTS __old_getdents64 +# define DIRENT_TYPE struct __old_dirent64 +# include +compat_symbol (libc, __old_readdir64_r, readdir64_r, GLIBC_2_1); +# endif /* SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) */ +#endif /* _DIRENT_MATCHES_DIRENT64 */ diff --git a/sysdeps/unix/sysv/linux/i386/readdir64.c b/sysdeps/unix/sysv/linux/readdir_r.c similarity index 51% rename from sysdeps/unix/sysv/linux/i386/readdir64.c rename to sysdeps/unix/sysv/linux/readdir_r.c index 42b7302..7ca9e8e 100644 --- a/sysdeps/unix/sysv/linux/i386/readdir64.c +++ b/sysdeps/unix/sysv/linux/readdir_r.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2000-2018 Free Software Foundation, Inc. +/* Read a directory in reentrant mode. Linux no-LFS version. + Copyright (C) 2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,32 +16,8 @@ License along with the GNU C Library; if not, see . */ -#define __READDIR __readdir64 -#define __GETDENTS __getdents64 -#define DIRENT_TYPE struct dirent64 +#include -#include - -#include - -#undef __READDIR -#undef __GETDENTS -#undef DIRENT_TYPE - -libc_hidden_def (__readdir64) -versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2); - -#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) - -#include - -#define __READDIR attribute_compat_text_section __old_readdir64 -#define __GETDENTS __old_getdents64 -#define DIRENT_TYPE struct __old_dirent64 - -#include - -libc_hidden_def (__old_readdir64) - -compat_symbol (libc, __old_readdir64, readdir64, GLIBC_2_1); +#if !_DIRENT_MATCHES_DIRENT64 +# include #endif diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/readdir64.c b/sysdeps/unix/sysv/linux/s390/s390-32/readdir64.c deleted file mode 100644 index 2ea26dd..0000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/readdir64.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/readdir64_r.c b/sysdeps/unix/sysv/linux/s390/s390-32/readdir64_r.c deleted file mode 100644 index 9f54f89..0000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/readdir64_r.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/readdir64.c b/sysdeps/unix/sysv/linux/sparc/sparc32/readdir64.c deleted file mode 100644 index 2ea26dd..0000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/readdir64.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/readdir64_r.c b/sysdeps/unix/sysv/linux/sparc/sparc32/readdir64_r.c deleted file mode 100644 index 9f54f89..0000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/readdir64_r.c +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/wordsize-64/readdir.c b/sysdeps/unix/sysv/linux/wordsize-64/readdir.c deleted file mode 100644 index 0d57988..0000000 --- a/sysdeps/unix/sysv/linux/wordsize-64/readdir.c +++ /dev/null @@ -1,8 +0,0 @@ -#define readdir64 __no_readdir64_decl -#define __readdir64 __no___readdir64_decl -#include -#undef __readdir64 -strong_alias (__readdir, __readdir64) -strong_alias (__readdir, __GI___readdir64) -#undef readdir64 -weak_alias (__readdir, readdir64) diff --git a/sysdeps/unix/sysv/linux/wordsize-64/readdir64.c b/sysdeps/unix/sysv/linux/wordsize-64/readdir64.c deleted file mode 100644 index 9796431..0000000 --- a/sysdeps/unix/sysv/linux/wordsize-64/readdir64.c +++ /dev/null @@ -1 +0,0 @@ -/* readdir64 is in readdir.c */ diff --git a/sysdeps/unix/sysv/linux/wordsize-64/readdir64_r.c b/sysdeps/unix/sysv/linux/wordsize-64/readdir64_r.c deleted file mode 100644 index b8fe9a3..0000000 --- a/sysdeps/unix/sysv/linux/wordsize-64/readdir64_r.c +++ /dev/null @@ -1 +0,0 @@ -/* readdir64_r is in readdir_r.c */ diff --git a/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c b/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c deleted file mode 100644 index 290f2c8..0000000 --- a/sysdeps/unix/sysv/linux/wordsize-64/readdir_r.c +++ /dev/null @@ -1,4 +0,0 @@ -#define readdir64_r __no_readdir64_r_decl -#include -#undef readdir64_r -weak_alias (__readdir_r, readdir64_r)