Browse Source

consolidate __xstat abi-compat functions into a single source file

these are mostly intended for use with dynamic linking (although they
can also be used statically with object files compiled against glibc
headers), so having them broken down into separate source files to
optimize for static linking is unlikely to be worth the cost having
more files in the source tree (which contributes to libc.a overhead,
compile time, link time, ar/linker command line size exhaustion, and
so on).
Rich Felker 10 years ago
parent
commit
76f2bcc7d6
4 changed files with 18 additions and 27 deletions
  1. 0 9
      src/stat/__fxstat.c
  2. 0 9
      src/stat/__fxstatat.c
  3. 0 9
      src/stat/__lxstat.c
  4. 18 0
      src/stat/__xstat.c

+ 0 - 9
src/stat/__fxstat.c

@@ -1,9 +0,0 @@
-#include <sys/stat.h>
-#include "libc.h"
-
-int __fxstat(int ver, int fd, struct stat *buf)
-{
-	return fstat(fd, buf);
-}
-
-LFS64(__fxstat);

+ 0 - 9
src/stat/__fxstatat.c

@@ -1,9 +0,0 @@
-#include <sys/stat.h>
-#include "libc.h"
-
-int __fxstatat(int ver, int fd, const char *path, struct stat *buf, int flag)
-{
-	return fstatat(fd, path, buf, flag);
-}
-
-LFS64(__fxstatat);

+ 0 - 9
src/stat/__lxstat.c

@@ -1,9 +0,0 @@
-#include <sys/stat.h>
-#include "libc.h"
-
-int __lxstat(int ver, const char *path, struct stat *buf)
-{
-	return lstat(path, buf);
-}
-
-LFS64(__lxstat);

+ 18 - 0
src/stat/__xstat.c

@@ -1,9 +1,27 @@
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include "libc.h"
 #include "libc.h"
 
 
+int __fxstat(int ver, int fd, struct stat *buf)
+{
+	return fstat(fd, buf);
+}
+
+int __fxstatat(int ver, int fd, const char *path, struct stat *buf, int flag)
+{
+	return fstatat(fd, path, buf, flag);
+}
+
+int __lxstat(int ver, const char *path, struct stat *buf)
+{
+	return lstat(path, buf);
+}
+
 int __xstat(int ver, const char *path, struct stat *buf)
 int __xstat(int ver, const char *path, struct stat *buf)
 {
 {
 	return stat(path, buf);
 	return stat(path, buf);
 }
 }
 
 
+LFS64(__fxstat);
+LFS64(__fxstatat);
+LFS64(__lxstat);
 LFS64(__xstat);
 LFS64(__xstat);