diff options
| author | Mike Frysinger <vapier@gentoo.org> | 2009-09-06 12:12:12 -0400 |
|---|---|---|
| committer | Austin Foxley <austinf@cetoncorp.com> | 2009-09-18 11:41:28 -0700 |
| commit | ec684d6572952195494d779bdb90c467e9449a66 (patch) | |
| tree | a2e18f16ac0926f8ced11c62d2981427302a93cd /libc/sysdeps/linux/common/fstatat.c | |
| parent | 364c8d64f92cb74dbb602d8eb1dacc7f47d33a2b (diff) | |
| download | uClibc-alpine-ec684d6572952195494d779bdb90c467e9449a66.tar.bz2 uClibc-alpine-ec684d6572952195494d779bdb90c467e9449a66.tar.xz | |
fstatat: fix up behavior on 32/64 bit hosts
The fstatat() syscall is a little funky in that it sometimes changes name
between 32 and 64 bit hosts, but it should always operate on a 64bit stat
structure. So for the fstatat() function, make sure we convert it from a
64bit kstat to a 32bit stat.
Along these lines, we need to restore the __xstat32_conv() function.
Reported-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc/sysdeps/linux/common/fstatat.c')
| -rw-r--r-- | libc/sysdeps/linux/common/fstatat.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/common/fstatat.c b/libc/sysdeps/linux/common/fstatat.c index 149c1890d..33daa7c98 100644 --- a/libc/sysdeps/linux/common/fstatat.c +++ b/libc/sysdeps/linux/common/fstatat.c @@ -10,15 +10,20 @@ #include <sys/stat.h> #include "xstatconv.h" +/* 64bit ports tend to favor newfstatat() */ +#ifdef __NR_newfstatat +# define __NR_fstatat64 __NR_newfstatat +#endif + #ifdef __NR_fstatat64 int fstatat(int fd, const char *file, struct stat *buf, int flag) { int ret; - struct kernel_stat kbuf; + struct kernel_stat64 kbuf; ret = INLINE_SYSCALL(fstatat64, 4, fd, file, &kbuf, flag); if (ret == 0) - __xstat_conv(&kbuf, buf); + __xstat32_conv(&kbuf, buf); return ret; } |
