diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/lxstat64.c')
-rw-r--r-- | sysdeps/unix/sysv/linux/lxstat64.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/sysdeps/unix/sysv/linux/lxstat64.c b/sysdeps/unix/sysv/linux/lxstat64.c index 44097653c7..1192940d48 100644 --- a/sysdeps/unix/sysv/linux/lxstat64.c +++ b/sysdeps/unix/sysv/linux/lxstat64.c @@ -32,10 +32,12 @@ # include <xstatconv.c> #endif -extern int __syscall_lstat (const char *__unbounded, struct kernel_stat *__unbounded); +extern int __syscall_lstat (const char *__unbounded, + struct kernel_stat *__unbounded); #ifdef __NR_lstat64 -extern int __syscall_lstat64 (const char *__unbounded, struct stat64 *__unbounded); +extern int __syscall_lstat64 (const char *__unbounded, + struct stat64 *__unbounded); # if __ASSUME_STAT64_SYSCALL == 0 /* The variable is shared between all wrappers around *stat64 calls. */ extern int __have_no_stat64; @@ -43,14 +45,21 @@ extern int __have_no_stat64; #endif /* Get information about the file NAME in BUF. */ +extern int ___lxstat64 (int vers, const char *name, struct stat64 *buf); + int -__lxstat64 (int vers, const char *name, struct stat64 *buf) +___lxstat64 (int vers, const char *name, struct stat64 *buf) { + int result; #ifdef __ASSUME_STAT64_SYSCALL - return INLINE_SYSCALL (lstat64, 2, CHECK_STRING (name), CHECK_1 (buf)); + result = INLINE_SYSCALL (lstat64, 2, CHECK_STRING (name), CHECK_1 (buf)); +# if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0 + if (!result && buf->__st_ino != (__ino_t)buf->st_ino) + buf->st_ino = buf->__st_ino; +# endif + return result; #else struct kernel_stat kbuf; - int result; # ifdef __NR_lstat64 if (! __have_no_stat64) { @@ -58,7 +67,13 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf) result = INLINE_SYSCALL (lstat64, 2, CHECK_STRING (name), CHECK_1 (buf)); if (result != -1 || errno != ENOSYS) - return result; + { +# if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0 + if (!result && buf->__st_ino != (__ino_t)buf->st_ino) + buf->st_ino = buf->__st_ino; +# endif + return result; + } __set_errno (saved_errno); __have_no_stat64 = 1; @@ -71,3 +86,12 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf) return result; #endif } + +#include <shlib-compat.h> + +versioned_symbol (libc, ___lxstat64, __lxstat64, GLIBC_2_2); + +#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2) +strong_alias (___lxstat64, __old__lxstat64) +compat_symbol (libc, __old__lxstat64, __lxstat64, GLIBC_2_1); +#endif |