public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] include/sys/stat.h: Add __USE_FILE_OFFSET64 redirection
@ 2020-11-08 16:42 Samuel Thibault
  2020-11-09 14:48 ` Adhemerval Zanella
  0 siblings, 1 reply; 4+ messages in thread
From: Samuel Thibault @ 2020-11-08 16:42 UTC (permalink / raw)
  To: libc-alpha; +Cc: Samuel Thibault, commit-hurd

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-11 12:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-08 16:42 [PATCH] include/sys/stat.h: Add __USE_FILE_OFFSET64 redirection Samuel Thibault
2020-11-09 14:48 ` Adhemerval Zanella
2020-11-10 21:58   ` Samuel Thibault
2020-11-11 12:31     ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).