This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] generic/wordsize-32: don't declare getdents() if not needed
- From: Yury Norov <ynorov at caviumnetworks dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Tue, 25 Oct 2016 23:45:38 +0300
- Subject: Re: [PATCH] generic/wordsize-32: don't declare getdents() if not needed
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Yuri dot Norov at caviumnetworks dot com;
- References: <1474304204-30677-1-git-send-email-ynorov@caviumnetworks.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Mon, Sep 19, 2016 at 07:56:44PM +0300, Yury Norov wrote:
>
> Modern 32-bit arches has off_t and ino_t types both 64-bit length. It means that
> struct dirent is the same as struct dirent64. So we can avoid useless conversion
> from 64- to 32-bit dirent layout, and simply alias __getdents64() to __getdents().
> The same is true if __USE_FILE_OFFSET64 option is enabled.
>
> Tested with aarch64/ilp32.
>
> 2016-09-19: Yury Norov <ynorov@caviumnetworks.com>
>
> * sysdeps/unix/sysv/linux/bits/dirent.h: enable _DIRENT_MATCHES_DIRENT64
> if __USE_FILE_OFFSET64 is enabled.
> * sysdeps/unix/sysv/linux/generic/getdents64.c: alias __getdents64() to
> __getdents() also if _DIRENT_MATCHES_DIRENT64 is enabled.
> * sysdeps/unix/sysv/linux/generic/wordsize-32/getdents.c: don't declare
> __getdents() if _DIRENT_MATCHES_DIRENT64 is enabled.
>
> Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Ping?