From 656167d89112171b2b7672676dc413c676a186f5 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 6 Sep 2009 12:12:12 -0400 Subject: fstatat: fix up behavior on 32/64 bit hosts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Mike Frysinger --- libc/sysdeps/linux/common/fstatat64.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libc/sysdeps/linux/common/fstatat64.c') diff --git a/libc/sysdeps/linux/common/fstatat64.c b/libc/sysdeps/linux/common/fstatat64.c index 5ae1fadba..95627afaf 100644 --- a/libc/sysdeps/linux/common/fstatat64.c +++ b/libc/sysdeps/linux/common/fstatat64.c @@ -12,6 +12,11 @@ #ifdef __UCLIBC_HAS_LFS__ +/* 64bit ports tend to favor newfstatat() */ +#ifdef __NR_newfstatat +# define __NR_fstatat64 __NR_newfstatat +#endif + #ifdef __NR_fstatat64 int fstatat64(int fd, const char *file, struct stat64 *buf, int flag) { -- cgit v1.2.3