diff options
author | Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> | 2017-05-24 10:27:17 +0200 |
---|---|---|
committer | Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> | 2017-05-24 10:29:39 +0200 |
commit | 382163bf91f32b6d1ea9d3f23122771758572818 (patch) | |
tree | 12008159ef27a317daf0a8f3b7dc985ad4f69961 | |
parent | 344177b0439bc25477514b7e52ac18e2d10fdf55 (diff) | |
download | glibc-aaribaud/y2038-2.23.tar.gz |
Add __fstatat64_t64, __fxstatat_t64aaribaud/y2038-2.23
-rw-r--r-- | io/Versions | 1 | ||||
-rw-r--r-- | io/fstatat64.c | 7 | ||||
-rw-r--r-- | io/sys/stat.h | 9 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/fxstatat64.c | 20 |
4 files changed, 36 insertions, 1 deletions
diff --git a/io/Versions b/io/Versions index 9bfca9a62e..e3650be2f4 100644 --- a/io/Versions +++ b/io/Versions @@ -129,5 +129,6 @@ libc { __xstat64_t64; __fxstat64_t64; __lxstat64_t64; + __fxstatat64_t64; } } diff --git a/io/fstatat64.c b/io/fstatat64.c index dcdccf87af..2903e3a0bf 100644 --- a/io/fstatat64.c +++ b/io/fstatat64.c @@ -50,3 +50,10 @@ fstatat64 (int fd, const char *file, struct stat64 *buf, int flag) { return __fxstatat64 (_STAT_VER, fd, file, buf, flag); } + +int +attribute_hidden +__fstatat64_t64 (int fd, const char *file, struct __stat64_t64 *buf, int flag) +{ + return __fxstatat64_t64 (_STAT_VER, fd, file, buf, flag); +} diff --git a/io/sys/stat.h b/io/sys/stat.h index 75a6fbb332..b2a86102e1 100644 --- a/io/sys/stat.h +++ b/io/sys/stat.h @@ -446,6 +446,10 @@ extern int __REDIRECT_NTH (__xstat, (int __ver, const char *__filename, extern int __REDIRECT_NTH (__lxstat, (int __ver, const char *__filename, struct stat *__stat_buf), __lxstat64_t64) __nonnull ((2, 3)); +extern int __REDIRECT_NTH (__fxstatat, (int __ver, int __fildes, + const char *__filename, + struct stat *__stat_buf, int __flag), + __fxstatat64_t64) __nonnull ((3, 4)); # else extern int __REDIRECT_NTH (__fxstat, (int __ver, int __fildes, struct stat *__stat_buf), __fxstat64) @@ -456,11 +460,11 @@ extern int __REDIRECT_NTH (__xstat, (int __ver, const char *__filename, extern int __REDIRECT_NTH (__lxstat, (int __ver, const char *__filename, struct stat *__stat_buf), __lxstat64) __nonnull ((2, 3)); -# endif extern int __REDIRECT_NTH (__fxstatat, (int __ver, int __fildes, const char *__filename, struct stat *__stat_buf, int __flag), __fxstatat64) __nonnull ((3, 4)); +# endif # else # ifdef __USE_TIME_BITS64 @@ -491,6 +495,9 @@ extern int __lxstat64_t64 (int __ver, const char *__filename, extern int __fxstatat64 (int __ver, int __fildes, const char *__filename, struct stat64 *__stat_buf, int __flag) __THROW __nonnull ((3, 4)); +extern int __fxstatat64_t64 (int __ver, int __fildes, const char *__filename, + struct __stat64_t64 *__stat_buf, int __flag) + __THROW __nonnull ((3, 4)); #endif extern int __xmknod (int __ver, const char *__path, __mode_t __mode, __dev_t *__dev) __THROW __nonnull ((2, 4)); diff --git a/sysdeps/unix/sysv/linux/fxstatat64.c b/sysdeps/unix/sysv/linux/fxstatat64.c index 7ffa2d4a9b..9114ea7570 100644 --- a/sysdeps/unix/sysv/linux/fxstatat64.c +++ b/sysdeps/unix/sysv/linux/fxstatat64.c @@ -26,6 +26,8 @@ #include <sysdep.h> #include <sys/syscall.h> +#include <xstatconv.h> + /* Get information about the file NAME in BUF. */ int @@ -45,3 +47,21 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag) err)); } libc_hidden_def (__fxstatat64) + +int +__fxstatat64_t64 (int vers, int fd, const char *file, struct __stat64_t64 *st, int flag) +{ + if (__glibc_unlikely (vers != _STAT_VER_LINUX)) + return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); + + int result; + struct kernel_stat st64; + INTERNAL_SYSCALL_DECL (err); + + result = INTERNAL_SYSCALL (fstatat64, err, 4, fd, file, &st64, flag); + if (!__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + return __xstat64_conv_t64 (vers, &st64, st); + else + return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result, + err)); +} |