public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] fstatat{,64} and openat64 fixes
@ 2005-11-17 21:18 Jakub Jelinek
  2005-11-17 21:31 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2005-11-17 21:18 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

When __USE_LARGEFILE64 is not defined, struct stat64 isn't defined
and this leads to errors.  While at it, I have noticed fstatat
doesn't handle the ifndef __REDIRECT_NTH case.

2005-11-17  Jakub Jelinek  <jakub@redhat.com>

	* io/sys/stat.h (fstatat): If __REDIRECT_NTH isn't defined,
	define fstatat to fstatat64.
	(fstatat64): Only provide prototype if __USE_LARGEFILE64,
	similarly with the inline.
	* io/fcntl.h (openat64): Only provide prototype if __USE_LARGEFILE64.

--- libc/io/sys/stat.h.jj	2005-11-17 21:22:38.000000000 +0100
+++ libc/io/sys/stat.h	2005-11-17 22:05:59.000000000 +0100
@@ -236,13 +236,19 @@ extern int fstat64 (int __fd, struct sta
 extern int fstatat (int __fd, __const char *__file, struct stat *__buf,
 		    int __flag) __THROW __nonnull ((2, 3));
 # else
+#  ifdef __REDIRECT_NTH
 extern int __REDIRECT_NTH (fstatat, (int __fd, __const char *__file,
 				     struct stat *__buf, int __flag),
 			   fstatat64) __nonnull ((2, 3));
+#  else
+#   define fstatat fstatat64
+#  endif
 # endif
 
+# ifdef __USE_LARGEFILE64
 extern int fstatat64 (int __fd, __const char *__file, struct stat64 *__buf,
 		      int __flag) __THROW __nonnull ((2, 3));
+# endif
 #endif
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
@@ -446,15 +452,16 @@ __NTH (fstat64 (int __fd, struct stat64 
 {
   return __fxstat64 (_STAT_VER, __fd, __statbuf);
 }
-# endif
 
-# ifdef __USE_GNU
+#  ifdef __USE_GNU
 extern __inline__ int
 __NTH (fstatat64 (int __fd, __const char *__filename, struct stat64 *__statbuf,
 		  int __flag))
 {
   return __fxstatat64 (_STAT_VER, __fd, __filename, __statbuf, __flag);
 }
+#  endif
+
 # endif
 
 #endif
--- libc/io/fcntl.h.jj	2005-11-17 22:09:14.000000000 +0100
+++ libc/io/fcntl.h	2005-11-17 22:09:14.000000000 +0100
@@ -114,8 +114,10 @@ extern int __REDIRECT (openat, (int __fd
 #  endif
 # endif
 
+# ifdef __USE_LARGEFILE64
 extern int openat64 (int __fd, __const char *__file, int __oflag, ...)
      __nonnull ((2));
+# endif
 #endif
 
 /* Create and open FILE, with mode MODE.  This takes an `int' MODE

	Jakub

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

* Re: [PATCH] fstatat{,64} and openat64 fixes
  2005-11-17 21:18 [PATCH] fstatat{,64} and openat64 fixes Jakub Jelinek
@ 2005-11-17 21:31 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2005-11-17 21:31 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

Applied.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

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

end of thread, other threads:[~2005-11-17 21:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-17 21:18 [PATCH] fstatat{,64} and openat64 fixes Jakub Jelinek
2005-11-17 21:31 ` Ulrich Drepper

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).