about summary refs log tree commit diff
path: root/io/sys
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-07-16 14:06:51 +0000
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-10-09 17:02:06 -0300
commit8ed005daf0ab03e142500324a34087ce179ae78e (patch)
tree2541dfc11ce5fe84696c84266a1b2eb22fe2f571 /io/sys
parent428985c436f442e91e27173bccaf28f547233586 (diff)
downloadglibc-8ed005daf0ab03e142500324a34087ce179ae78e.tar.gz
glibc-8ed005daf0ab03e142500324a34087ce179ae78e.tar.xz
glibc-8ed005daf0ab03e142500324a34087ce179ae78e.zip
Remove stat wrapper functions, move them to exported symbols
This patch removes the stat, stat64, lstat, lstat64, fstat, fstat64,
fstatat, and fstatat64 static wrapper and add the symbol on the libc
with the expected names.

Both the prototypes of the internal symbol linked by the static
wrappers and the inline redirectors are also removed from the installed
sys/stat.h header file.  The wrapper implementation license LGPL
exception is also removed since it is no longer statically linked to
binaries.

Internally the _STAT_VER* definitions are moved to a arch-specific
xstatver.h file.  The internal defines that redirects internals
{f}stat{at} to their {f}xstat{at} counterparts are removed for Linux
(!NO_RTLD_HIDDEN).  Hurd still requires them since {f}stat{at} pulls
extra objects that makes the loader build fail otherwise (I haven't
dig into why exactly).

Checked with a build for all affected ABIs. I also checked on x86_64,
i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'io/sys')
-rw-r--r--io/sys/stat.h129
1 files changed, 0 insertions, 129 deletions
diff --git a/io/sys/stat.h b/io/sys/stat.h
index 69e333656a..eb9cf5d5af 100644
--- a/io/sys/stat.h
+++ b/io/sys/stat.h
@@ -368,73 +368,10 @@ extern int utimensat (int __fd, const char *__path,
 extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
 #endif
 
-/* To allow the `struct stat' structure and the file type `mode_t'
-   bits to vary without changing shared library major version number,
-   the `stat' family of functions and `mknod' are in fact inline
-   wrappers around calls to `xstat', `fxstat', `lxstat', and `xmknod',
-   which all take a leading version-number argument designating the
-   data structure and bits used.  <bits/stat.h> defines _STAT_VER with
-   the version number corresponding to `struct stat' as defined in
-   that file; and _MKNOD_VER with the version number corresponding to
-   the S_IF* macros defined therein.  It is arranged that when not
-   inlined these function are always statically linked; that way a
-   dynamically-linked executable always encodes the version number
-   corresponding to the data structures it uses, so the `x' functions
-   in the shared library can adapt without needing to recompile all
-   callers.  */
-
-#ifndef _STAT_VER
-# define _STAT_VER	0
-#endif
 #ifndef _MKNOD_VER
 # define _MKNOD_VER	0
 #endif
 
-/* Wrappers for stat and mknod system calls.  */
-#ifndef __USE_FILE_OFFSET64
-extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf)
-     __THROW __nonnull ((3));
-extern int __xstat (int __ver, const char *__filename,
-		    struct stat *__stat_buf) __THROW __nonnull ((2, 3));
-extern int __lxstat (int __ver, const char *__filename,
-		     struct stat *__stat_buf) __THROW __nonnull ((2, 3));
-extern int __fxstatat (int __ver, int __fildes, const char *__filename,
-		       struct stat *__stat_buf, int __flag)
-     __THROW __nonnull ((3, 4));
-#else
-# ifdef __REDIRECT_NTH
-extern int __REDIRECT_NTH (__fxstat, (int __ver, int __fildes,
-				      struct stat *__stat_buf), __fxstat64)
-     __nonnull ((3));
-extern int __REDIRECT_NTH (__xstat, (int __ver, const char *__filename,
-				     struct stat *__stat_buf), __xstat64)
-     __nonnull ((2, 3));
-extern int __REDIRECT_NTH (__lxstat, (int __ver, const char *__filename,
-				      struct stat *__stat_buf), __lxstat64)
-     __nonnull ((2, 3));
-extern int __REDIRECT_NTH (__fxstatat, (int __ver, int __fildes,
-					const char *__filename,
-					struct stat *__stat_buf, int __flag),
-			   __fxstatat64) __nonnull ((3, 4));
-
-# else
-#  define __fxstat __fxstat64
-#  define __xstat __xstat64
-#  define __lxstat __lxstat64
-# endif
-#endif
-
-#ifdef __USE_LARGEFILE64
-extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf)
-     __THROW __nonnull ((3));
-extern int __xstat64 (int __ver, const char *__filename,
-		      struct stat64 *__stat_buf) __THROW __nonnull ((2, 3));
-extern int __lxstat64 (int __ver, const char *__filename,
-		       struct stat64 *__stat_buf) __THROW __nonnull ((2, 3));
-extern int __fxstatat64 (int __ver, int __fildes, const char *__filename,
-			 struct stat64 *__stat_buf, int __flag)
-     __THROW __nonnull ((3, 4));
-#endif
 extern int __xmknod (int __ver, const char *__path, __mode_t __mode,
 		     __dev_t *__dev) __THROW __nonnull ((2, 4));
 
@@ -447,37 +384,6 @@ extern int __xmknodat (int __ver, int __fd, const char *__path,
 #endif
 
 #ifdef __USE_EXTERN_INLINES
-/* Inlined versions of the real stat and mknod functions.  */
-
-__extern_inline int
-__NTH (stat (const char *__path, struct stat *__statbuf))
-{
-  return __xstat (_STAT_VER, __path, __statbuf);
-}
-
-# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
-__extern_inline int
-__NTH (lstat (const char *__path, struct stat *__statbuf))
-{
-  return __lxstat (_STAT_VER, __path, __statbuf);
-}
-# endif
-
-__extern_inline int
-__NTH (fstat (int __fd, struct stat *__statbuf))
-{
-  return __fxstat (_STAT_VER, __fd, __statbuf);
-}
-
-# ifdef __USE_ATFILE
-__extern_inline int
-__NTH (fstatat (int __fd, const char *__filename, struct stat *__statbuf,
-		int __flag))
-{
-  return __fxstatat (_STAT_VER, __fd, __filename, __statbuf, __flag);
-}
-# endif
-
 # ifdef __USE_MISC
 __extern_inline int
 __NTH (mknod (const char *__path, __mode_t __mode, __dev_t __dev))
@@ -496,41 +402,6 @@ __NTH (mknodat (int __fd, const char *__path, __mode_t __mode,
 }
 #  endif
 # endif
-
-# if defined __USE_LARGEFILE64 \
-  && (! defined __USE_FILE_OFFSET64 \
-      || (defined __REDIRECT_NTH && defined __OPTIMIZE__))
-__extern_inline int
-__NTH (stat64 (const char *__path, struct stat64 *__statbuf))
-{
-  return __xstat64 (_STAT_VER, __path, __statbuf);
-}
-
-#  if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
-__extern_inline int
-__NTH (lstat64 (const char *__path, struct stat64 *__statbuf))
-{
-  return __lxstat64 (_STAT_VER, __path, __statbuf);
-}
-#  endif
-
-__extern_inline int
-__NTH (fstat64 (int __fd, struct stat64 *__statbuf))
-{
-  return __fxstat64 (_STAT_VER, __fd, __statbuf);
-}
-
-#  ifdef __USE_ATFILE
-__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
 
 __END_DECLS