Message ID | 201611072213.uA7MDcpB020773@sellcey-lt.caveonetworks.com |
---|---|
State | New |
Headers | show |
On Nov 07 2016, Steve Ellcey <sellcey@cavium.com> wrote: > My main question is, is this an OK use of '#ifdef' or should the > STATFS_IS_STATFS64 be defined on all platforms (presumably in kernel_stat.h) > so that we can check the value instead of checking to see it is defined > or not? Since it is a new symbol it should follow the policy of always being defined. > * sysdeps/unix/sysv/linux/fstatfs64.c: Make __fstatfs and fstatfs > aliases of __fstatfs64 if __STATFS_IS_STATFS64 is set. > * sysdeps/unix/sysv/linux/statfs64.c: Ditto for __statfs, statfs, > and __statfs64. > * sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c: Do not > define __fstatfs and fstatfs if __STATFS_IS_STATFS64 is set. > * sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c: Ditto > for __statfs and statfs. It's STATFS_IS_STATFS64, not __STATFS_IS_STATFS64. Andreas.
On Thu, 2016-11-17 at 09:53 +0100, Andreas Schwab wrote: > On Nov 07 2016, Steve Ellcey <sellcey@cavium.com> wrote: > > > > > My main question is, is this an OK use of '#ifdef' or should the > > STATFS_IS_STATFS64 be defined on all platforms (presumably in > > kernel_stat.h) > > so that we can check the value instead of checking to see it is > > defined > > or not? > Since it is a new symbol it should follow the policy of always being > defined. OK, but since having STATFS_IS_STATFS64 be handled one way and XSTAT_IS_XSTAT64 handled a different way bothers my sense of consistency I am going to first submit a patch to always define XSTAT_IS_XSTAT64, then redo this patch. Hopefully a patch to always define XSTAT_IS_XSTAT64 will be acceptable (after testing, etc). Steve Ellcey sellcey@caviumnetworks.com
diff --git a/sysdeps/unix/sysv/linux/fstatfs64.c b/sysdeps/unix/sysv/linux/fstatfs64.c index a624de6..ac11fff 100644 --- a/sysdeps/unix/sysv/linux/fstatfs64.c +++ b/sysdeps/unix/sysv/linux/fstatfs64.c @@ -70,3 +70,8 @@ __fstatfs64 (int fd, struct statfs64 *buf) #endif } weak_alias (__fstatfs64, fstatfs64) + +#ifdef STATFS_IS_STATFS64 +weak_alias (__fstatfs64, __fstatfs) +weak_alias (__fstatfs64, fstatfs) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c index be9599a..e41afb9 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/fstatfs.c @@ -20,6 +20,7 @@ #include <sys/statfs.h> #include <stddef.h> +#ifndef STATFS_IS_STATFS64 #include "overflow.h" /* Return information about the filesystem on which FD resides. */ @@ -30,3 +31,4 @@ __fstatfs (int fd, struct statfs *buf) return rc ?: statfs_overflow (buf); } weak_alias (__fstatfs, fstatfs) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c b/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c index 1937f05..a7f9187 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/statfs.c @@ -20,6 +20,7 @@ #include <sys/statfs.h> #include <stddef.h> +#ifndef STATFS_IS_STATFS64 #include "overflow.h" /* Return information about the filesystem on which FILE resides. */ @@ -31,3 +32,4 @@ __statfs (const char *file, struct statfs *buf) } libc_hidden_def (__statfs) weak_alias (__statfs, statfs) +#endif diff --git a/sysdeps/unix/sysv/linux/statfs64.c b/sysdeps/unix/sysv/linux/statfs64.c index de42261..c75d4cf 100644 --- a/sysdeps/unix/sysv/linux/statfs64.c +++ b/sysdeps/unix/sysv/linux/statfs64.c @@ -72,3 +72,9 @@ __statfs64 (const char *file, struct statfs64 *buf) #endif } weak_alias (__statfs64, statfs64) + +#ifdef STATFS_IS_STATFS64 +weak_alias (__statfs64, __statfs) +weak_alias (__statfs64, statfs) +libc_hidden_ver (__statfs64, __statfs) +#endif