commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] include/sys/stat.h: Add __USE_FILE_OFFSET64 redirection


From: Samuel Thibault
Subject: [PATCH] include/sys/stat.h: Add __USE_FILE_OFFSET64 redirection
Date: Sun, 8 Nov 2020 17:42:03 +0100

Tests use include/sys/stat.h, which redirects the tests'
{,l,f}stat calls to __{,l,f}xstat calls. When a test is specifying
__USE_FILE_OFFSET64 (such as support/test-container.c), this
becomes bogus because while {,l,f}stat have the 64bit redirection,
__{,l,f}xstat did not have yet. This adds them.
---
 include/sys/stat.h | 30 +++++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/include/sys/stat.h b/include/sys/stat.h
index 108cb0c9bf..692850740f 100644
--- a/include/sys/stat.h
+++ b/include/sys/stat.h
@@ -29,14 +29,25 @@ in_blkcnt_t_range (__blkcnt64_t v)
 }
 
 /* Now define the internal interfaces. */
+#ifndef __USE_FILE_OFFSET64
 extern int __stat (const char *__file, struct stat *__buf);
-extern int __stat64 (const char *__file, struct stat64 *__buf);
 extern int __fstat (int __fd, struct stat *__buf);
-extern int __fstat64 (int __fd, struct stat64 *__buf);
 extern int __lstat (const char *__file, struct stat *__buf);
-extern int __lstat64 (const char *__file, struct stat64 *__buf);
 extern int __fstatat (int dirfd, const char *pathname, struct stat *buf,
                      int flags);
+#else
+extern int __REDIRECT_NTH (__stat,
+               (const char *__file, struct stat *__buf), __stat64);
+extern int __REDIRECT_NTH (__fstat,
+               (int __fd, struct stat *__buf), __fstat64);
+extern int __REDIRECT_NTH (__lstat,
+               (const char *__file, struct stat *__buf), __lstat64);
+extern int __REDIRECT_NTH(__fstatat,
+               (int dirfd, const char *pathname, struct stat *buf, int flags), 
__fstatat64);
+#endif
+extern int __stat64 (const char *__file, struct stat64 *__buf);
+extern int __fstat64 (int __fd, struct stat64 *__buf);
+extern int __lstat64 (const char *__file, struct stat64 *__buf);
 extern int __fstatat64 (int dirfd, const char *pathname, struct stat64 *buf,
                        int flags);
 # if IS_IN (libc) || (IS_IN (rtld) && !defined NO_RTLD_HIDDEN)
@@ -82,12 +93,25 @@ extern int __xmknod (int __ver, const char *__path, 
__mode_t __mode,
 extern int __xmknodat (int __ver, int __fd, const char *__path,
                       __mode_t __mode, __dev_t *__dev);
 
+#ifndef __USE_FILE_OFFSET64
 int __fxstat (int __ver, int __fildes, struct stat *__stat_buf);
 int __xstat (int __ver, const char *__filename,
             struct stat *__stat_buf);
 int __lxstat (int __ver, const char *__filename, struct stat *__stat_buf);
 int __fxstatat (int __ver, int __fildes, const char *__filename,
                struct stat *__stat_buf, int __flag);
+#else
+int __REDIRECT_NTH (__fxstat,
+               (int __ver, int __fildes, struct stat *__stat_buf), __fxstat64);
+int __REDIRECT_NTH (__xstat,
+               (int __ver, const char *__filename,
+                struct stat *__stat_buf), __xstat64);
+int __REDIRECT_NTH (__lxstat,
+               (int __ver, const char *__filename, struct stat *__stat_buf), 
__lxstat64);
+int __REDIRECT_NTH (__fxstatat,
+               (int __ver, int __fildes, const char *__filename,
+                struct stat *__stat_buf, int __flag), __fxstatat64);
+#endif
 int __fxstat64 (int ver, int __fildes, struct stat64 *__stat_buf);
 int __xstat64 (int ver, const char *__filename, struct stat64 *__stat_buf);
 int __lxstat64 (int ver, const char *__filename, struct stat64 *__stat_buf);
-- 
2.28.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]