This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] sys/stat.h fix


Hi!

With current sys/stat.h it is impossible to compile a C++ program which
includes it and is compiled with -D_FILE_OFFSET_BITS=64
-D_LARGEFILE64_SOURCE. The reason is that C++ puts extern inlines into
linkonce section, but as e.g. both fstat and fstat64 have the same assembly
name (fstat64), it dies because there are two identical symbols in one
section. While fixing that, I've noticed that if __REDIRECT is not defined,
then it will die because there will be two inlines with the same name
(redefinition of `fstat64' will happen).

2000-06-30  Jakub Jelinek  <jakub@redhat.com>

	* io/sys/stat.h (stat64, lstat64, fstat64): Don't define inlines
	if redirecting and either redirection is done using defines or
	not optimizing.

--- libc/io/sys/stat.h.jj	Fri Jun 30 22:58:46 2000
+++ libc/io/sys/stat.h	Fri Jun 30 22:59:43 2000
@@ -360,7 +360,9 @@ extern __inline__ int mknod (__const cha
 }
 # endif
 
-# ifdef __USE_LARGEFILE64
+# if defined __USE_LARGEFILE64 && \
+  (! defined __USE_FILE_OFFSET64 || \
+   (defined __REDIRECT && defined __OPTIMIZE__))
 extern __inline__ int stat64 (__const char *__path,
 			      struct stat64 *__statbuf) __THROW
 {

	Jakub

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]