]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove internal usage of extensible stat functions
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 15 Jul 2020 19:35:58 +0000 (19:35 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 11 Sep 2020 17:35:32 +0000 (14:35 -0300)
It replaces the internal usage of __{f,l}xstat{at}{64} with the
__{f,l}stat{at}{64}.  It should not change the generate code since
sys/stat.h explicit defines redirections to internal calls back to
xstat* symbols.

Checked with a build for all affected ABIs.  I also check on
x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
56 files changed:
catgets/open_catalog.c
csu/check_fds.c
elf/cache.c
elf/dl-load.c
elf/dl-misc.c
elf/dl-profile.c
iconv/gconv_cache.c
include/sys/stat.h
inet/rcmd.c
inet/ruserpass.c
intl/loadmsgcat.c
io/file_change_detection.c
io/fts.c
io/fts64.c
io/ftw.c
io/ftw64.c
io/getdirname.c
io/mkdirat.c
io/mkfifoat.c
io/openat.c
io/openat64.c
io/xmknodat.c
libio/fileops.c
locale/loadarchive.c
locale/loadlocale.c
misc/daemon.c
misc/getusershell.c
nptl/sem_open.c
nscd/nscd_helper.c
posix/glob.c
stdlib/canonicalize.c
sysdeps/gnu/glob64-lstat-compat.c
sysdeps/gnu/glob64.c
sysdeps/mach/hurd/ptsname.c
sysdeps/posix/dl-fileid.h
sysdeps/posix/euidaccess.c
sysdeps/posix/fdopendir.c
sysdeps/posix/fpathconf.c
sysdeps/posix/getaddrinfo.c
sysdeps/posix/isfdtype.c
sysdeps/posix/opendir.c
sysdeps/posix/pathconf.c
sysdeps/posix/posix_fallocate.c
sysdeps/posix/posix_fallocate64.c
sysdeps/posix/sysconf.c
sysdeps/posix/tempname.c
sysdeps/unix/sysv/linux/faccessat.c
sysdeps/unix/sysv/linux/fexecve.c
sysdeps/unix/sysv/linux/oldglob.c
sysdeps/unix/sysv/linux/pathconf.c
sysdeps/unix/sysv/linux/ptsname.c
sysdeps/unix/sysv/linux/ttyname.c
sysdeps/unix/sysv/linux/ttyname_r.c
sysvipc/ftok.c
time/getdate.c
time/tzfile.c

index 6b14963d789f58983ef874d9a001292a4c987b2d..cf8d635ae79fafd6b213a51be795b2b04f37cc5b 100644 (file)
@@ -194,7 +194,7 @@ __open_catalog (const char *cat_name, const char *nlspath, const char *env_var,
       return -1;
     }
 
-  if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) < 0)
+  if (__builtin_expect (__fstat64 (fd, &st), 0) < 0)
     goto close_unlock_return;
 
   if (__builtin_expect (!S_ISREG (st.st_mode), 0)
index 30634b81a75606f9f4b3e66fb452f542c521e974..29d9d04acb9db3dfcc938c2cbca62a16bdce0d68 100644 (file)
@@ -71,7 +71,7 @@ check_one_fd (int fd, int mode)
         decsriptor numbers, in this order.  */
       struct stat64 st;
       if (__builtin_expect (nullfd != fd, 0)
-         || __builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) != 0
+         || __builtin_expect (__fstat64 (fd, &st), 0) != 0
          || __builtin_expect (S_ISCHR (st.st_mode), 1) == 0
          || st.st_rdev != dev)
        /* We cannot even give an error message here since it would
index d92b4e59c15de598d2b811a16324040ec1a61310..1eb1455883a72a38b327e10a4d5f507ba5733ce8 100644 (file)
@@ -163,7 +163,7 @@ print_cache (const char *cache_name)
     error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"), cache_name);
 
   struct stat64 st;
-  if (fstat64 (fd, &st) < 0
+  if (__fstat64 (fd, &st) < 0
       /* No need to map the file if it is empty.  */
       || st.st_size == 0)
     {
@@ -699,7 +699,7 @@ load_aux_cache (const char *aux_cache_name)
     }
 
   struct stat64 st;
-  if (fstat64 (fd, &st) < 0 || st.st_size < sizeof (struct aux_cache_file))
+  if (__fstat64 (fd, &st) < 0 || st.st_size < sizeof (struct aux_cache_file))
     {
       close (fd);
       init_aux_cache ();
index e39980fb192dc19769d4e78142c277efac56b31b..646c5dca40efcc9ba9f39dbda8b189864792216d 100644 (file)
@@ -1914,7 +1914,7 @@ open_path (const char *name, size_t namelen, int mode,
 
                  buf[buflen - namelen - 1] = '\0';
 
-                 if (__xstat64 (_STAT_VER, buf, &st) != 0
+                 if (__stat64 (buf, &st) != 0
                      || ! S_ISDIR (st.st_mode))
                    /* The directory does not exist or it is no directory.  */
                    this_dir->status[cnt] = nonexisting;
@@ -1934,7 +1934,7 @@ open_path (const char *name, size_t namelen, int mode,
                 directories and so exploit the bugs.  */
              struct stat64 st;
 
-             if (__fxstat64 (_STAT_VER, fd, &st) != 0
+             if (__fstat64 (fd, &st) != 0
                  || (st.st_mode & S_ISUID) == 0)
                {
                  /* The shared object cannot be tested for being SUID
index f9d1fd7993d1648963db0f7ab82c737375403c08..aee62e1e60449d6e3dd3a10b9e8ec61caf172f22 100644 (file)
@@ -47,7 +47,7 @@ _dl_sysdep_read_whole_file (const char *file, size_t *sizep, int prot)
   int fd = __open64_nocancel (file, O_RDONLY | O_CLOEXEC);
   if (fd >= 0)
     {
-      if (__fxstat64 (_STAT_VER, fd, &st) >= 0)
+      if (__fstat64 (fd, &st) >= 0)
        {
          *sizep = st.st_size;
 
index c681f5415ca266c7fb7902512df718bb8aaa5c45..89dd70ba3b1f214f869912ef99f0e8725c4e1a70 100644 (file)
@@ -342,7 +342,7 @@ _dl_start_profile (void)
       return;
     }
 
-  if (__fxstat64 (_STAT_VER, fd, &st) < 0 || !S_ISREG (st.st_mode))
+  if (__fstat64 (fd, &st) < 0 || !S_ISREG (st.st_mode))
     {
       /* Not stat'able or not a regular file => don't use it.  */
       errstr = "%s: cannot stat file: %s\n";
index 9fe371b4c012d5da13c73845540cde08d55eee7f..b326cd19e257d6be93dda981d42758625be5724c 100644 (file)
@@ -64,7 +64,7 @@ __gconv_load_cache (void)
     return -1;
 
   /* Get information about the file.  */
-  if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) < 0
+  if (__builtin_expect (__fstat64 (fd, &st), 0) < 0
       /* We do not have to start looking at the file if it cannot contain
         at least the cache header.  */
       || (size_t) st.st_size < sizeof (struct gconvcache_header))
index 92284ca48b5b3df56dc7f30045ad2f956a0070b7..f8847cf73efb3a9adeab8da9e327e73b765b50e6 100644 (file)
@@ -53,6 +53,7 @@ extern __typeof (__fxstatat64) __fxstatat64 attribute_hidden;
 #define lstat64(fname, buf)  __lxstat64 (_STAT_VER, fname, buf)
 #define __lstat64(fname, buf)  __lxstat64 (_STAT_VER, fname, buf)
 #define stat64(fname, buf) __xstat64 (_STAT_VER, fname, buf)
+#define __stat64(fname, buf) __xstat64 (_STAT_VER, fname, buf)
 #define fstat64(fd, buf) __fxstat64 (_STAT_VER, fd, buf)
 #define __fstat64(fd, buf) __fxstat64 (_STAT_VER, fd, buf)
 #define fstat(fd, buf) __fxstat (_STAT_VER, fd, buf)
index 8a9616f847e1ff0f0af5b739a8921402b961e84a..452ff7d0993fcfeae985113cebb574e012e0df46 100644 (file)
@@ -474,7 +474,7 @@ iruserfopen (const char *file, uid_t okuser)
   /* If not a regular file, if owned by someone other than user or
      root, if writeable by anyone but the owner, or if hardlinked
      anywhere, quit.  */
-  if (__lxstat64 (_STAT_VER, file, &st))
+  if (__lstat64 (file, &st))
     cp = _("lstat failed");
   else if (!S_ISREG (st.st_mode))
     cp = _("not regular file");
@@ -483,7 +483,7 @@ iruserfopen (const char *file, uid_t okuser)
       res = fopen (file, "rce");
       if (!res)
        cp = _("cannot open");
-      else if (__fxstat64 (_STAT_VER, fileno (res), &st) < 0)
+      else if (__fstat64 (fileno (res), &st) < 0)
        cp = _("fstat failed");
       else if (st.st_uid && st.st_uid != okuser)
        cp = _("bad owner");
index 4fa6520c1ac5659a0d9acf6cdc80df57da1bc894..d61a72877d20b7e52a6d5c9b6bbbeb9452fb4dc6 100644 (file)
@@ -174,7 +174,7 @@ next:
                        break;
                case PASSWD:
                        if (strcmp(*aname, "anonymous") &&
-                           fstat64(fileno(cfile), &stb) >= 0 &&
+                           __fstat64(fileno(cfile), &stb) >= 0 &&
                            (stb.st_mode & 077) != 0) {
        warnx(_("Error: .netrc file is readable by others."));
        warnx(_("Remove 'password' line or make file unreadable by others."));
index 91c1ef156a6939e694b5711d8aa0bc9b217bc8df..d44a4a0b1483a089c04fd5c9c637f80cee6c82e4 100644 (file)
@@ -804,7 +804,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file,
   /* We must know about the size of the file.  */
   if (
 #ifdef _LIBC
-      __builtin_expect (fstat64 (fd, &st) != 0, 0)
+      __builtin_expect (__fstat64 (fd, &st) != 0, 0)
 #else
       __builtin_expect (fstat (fd, &st) != 0, 0)
 #endif
index c6d700ed05acc4ca09169b39af45fd6f3a38d4f9..f52d8fecfa7e01c19297ffe723960596ec66341a 100644 (file)
@@ -67,7 +67,7 @@ __file_change_detection_for_path (struct file_change_detection *file,
                                   const char *path)
 {
   struct stat64 st;
-  if (stat64 (path, &st) != 0)
+  if (__stat64 (path, &st) != 0)
     switch (errno)
       {
       case EACCES:
@@ -105,7 +105,7 @@ __file_change_detection_for_fp (struct file_change_detection *file,
   else
     {
       struct stat64 st;
-      if (fstat64 (__fileno (fp), &st) != 0)
+      if (__fstat64 (__fileno (fp), &st) != 0)
         /* If we already have a file descriptor, all errors are fatal.  */
         return false;
       else
index ba836918595aae3a7dff582f5c0a8aa60f8be3e6..9668a205c31aa4e14ced1cd6e069c6cceba3c4c2 100644 (file)
--- a/io/fts.c
+++ b/io/fts.c
@@ -81,8 +81,9 @@ static char sccsid[] = "@(#)fts.c     8.6 (Berkeley) 8/14/94";
 # define FTSOBJ FTS
 # define FTSENTRY FTSENT
 # define INO_T ino_t
-# define STAT stat
-# define LSTAT lstat
+# define STRUCT_STAT stat
+# define STAT __stat
+# define LSTAT __lstat
 #endif
 
 static FTSENTRY        *fts_alloc (FTSOBJ *, const char *, size_t);
@@ -872,7 +873,7 @@ fts_stat (FTSOBJ *sp, FTSENTRY *p, int follow)
        FTSENTRY *t;
        dev_t dev;
        INO_T ino;
-       struct STAT *sbp, sb;
+       struct STRUCT_STAT *sbp, sb;
        int saved_errno;
 
        /* If user needs stat info, stat buffer already allocated. */
@@ -906,7 +907,7 @@ fts_stat (FTSOBJ *sp, FTSENTRY *p, int follow)
                }
        } else if (LSTAT(p->fts_accpath, sbp)) {
                p->fts_errno = errno;
-err:           memset(sbp, 0, sizeof(struct STAT));
+err:           memset(sbp, 0, sizeof(struct STRUCT_STAT));
                return (FTS_NS);
        }
 
@@ -996,7 +997,7 @@ fts_alloc (FTSOBJ *sp, const char *name, size_t namelen)
         */
        len = sizeof(FTSENTRY) + namelen;
        if (!ISSET(FTS_NOSTAT))
-               len += sizeof(struct STAT) + ALIGNBYTES;
+               len += sizeof(struct STRUCT_STAT) + ALIGNBYTES;
        if ((p = malloc(len)) == NULL)
                return (NULL);
 
@@ -1005,7 +1006,7 @@ fts_alloc (FTSOBJ *sp, const char *name, size_t namelen)
        p->fts_name[namelen] = '\0';
 
        if (!ISSET(FTS_NOSTAT))
-               p->fts_statp = (struct STAT *)ALIGN(p->fts_name + namelen + 2);
+               p->fts_statp = (struct STRUCT_STAT *)ALIGN(p->fts_name + namelen + 2);
        p->fts_namelen = namelen;
        p->fts_path = sp->fts_path;
        p->fts_errno = 0;
@@ -1116,7 +1117,7 @@ fts_safe_changedir (FTSOBJ *sp, FTSENTRY *p, int fd, const char *path)
                return (0);
        if (fd < 0 && (newfd = __open(path, O_RDONLY, 0)) < 0)
                return (-1);
-       if (__fxstat64(_STAT_VER, newfd, &sb)) {
+       if (__fstat64(newfd, &sb)) {
                ret = -1;
                goto bail;
        }
index 3d9c77979151febc1c72f2e2f2437a5885806592..466703da374f57a56103e2b359766bde947a48bf 100644 (file)
@@ -24,7 +24,8 @@
 #define FTSOBJ FTS64
 #define FTSENTRY FTSENT64
 #define INO_T ino64_t
-#define STAT stat64
-#define LSTAT lstat64
+#define STRUCT_STAT stat64
+#define STAT __stat64
+#define LSTAT __lstat64
 
 #include "fts.c"
index 8c79d29a9efaa2b2a6a930c063063d116b010df2..7104816e85a8e3d6675a2cd3c7239c979842d7b1 100644 (file)
--- a/io/ftw.c
+++ b/io/ftw.c
@@ -135,15 +135,15 @@ int rpl_lstat (const char *, struct stat *);
 # define NFTW_OLD_NAME __old_nftw
 # define NFTW_NEW_NAME __new_nftw
 # define INO_T ino_t
-# define STAT stat
+# define STRUCT_STAT stat
 # ifdef _LIBC
-#  define LXSTAT __lxstat
-#  define XSTAT __xstat
-#  define FXSTATAT __fxstatat
+#  define LSTAT __lstat
+#  define STAT __stat
+#  define FSTATAT __fstatat
 # else
-#  define LXSTAT(V,f,sb) lstat (f,sb)
-#  define XSTAT(V,f,sb) stat (f,sb)
-#  define FXSTATAT(V,d,f,sb,m) fstatat (d, f, sb, m)
+#  define LSTAT lstat
+#  define XTAT stat
+#  define FSTATAT fstatat
 # endif
 # define FTW_FUNC_T __ftw_func_t
 # define NFTW_FUNC_T __nftw_func_t
@@ -219,7 +219,7 @@ static const int ftw_arr[] =
 
 
 /* Forward declarations of local functions.  */
-static int ftw_dir (struct ftw_data *data, struct STAT *st,
+static int ftw_dir (struct ftw_data *data, struct STRUCT_STAT *st,
                    struct dir_data *old_dir);
 
 
@@ -239,7 +239,7 @@ object_compare (const void *p1, const void *p2)
 
 
 static int
-add_object (struct ftw_data *data, struct STAT *st)
+add_object (struct ftw_data *data, struct STRUCT_STAT *st)
 {
   struct known_object *newp = malloc (sizeof (struct known_object));
   if (newp == NULL)
@@ -251,7 +251,7 @@ add_object (struct ftw_data *data, struct STAT *st)
 
 
 static inline int
-find_object (struct ftw_data *data, struct STAT *st)
+find_object (struct ftw_data *data, struct STRUCT_STAT *st)
 {
   struct known_object obj;
   obj.dev = st->st_dev;
@@ -378,7 +378,7 @@ static int
 process_entry (struct ftw_data *data, struct dir_data *dir, const char *name,
               size_t namlen, int d_type)
 {
-  struct STAT st;
+  struct STRUCT_STAT st;
   int result = 0;
   int flag = 0;
   size_t new_buflen;
@@ -405,16 +405,16 @@ process_entry (struct ftw_data *data, struct dir_data *dir, const char *name,
 
   int statres;
   if (dir->streamfd != -1)
-    statres = FXSTATAT (_STAT_VER, dir->streamfd, name, &st,
-                       (data->flags & FTW_PHYS) ? AT_SYMLINK_NOFOLLOW : 0);
+    statres = FSTATAT (dir->streamfd, name, &st,
+                      (data->flags & FTW_PHYS) ? AT_SYMLINK_NOFOLLOW : 0);
   else
     {
       if ((data->flags & FTW_CHDIR) == 0)
        name = data->dirbuf;
 
       statres = ((data->flags & FTW_PHYS)
-                ? LXSTAT (_STAT_VER, name, &st)
-                : XSTAT (_STAT_VER, name, &st));
+                ? LSTAT (name, &st)
+                : STAT (name, &st));
     }
 
   if (statres < 0)
@@ -430,10 +430,10 @@ process_entry (struct ftw_data *data, struct dir_data *dir, const char *name,
             it should contain information about the link (ala lstat).
             We do our best to fill in what data we can.  */
          if (dir->streamfd != -1)
-           statres = FXSTATAT (_STAT_VER, dir->streamfd, name, &st,
-                               AT_SYMLINK_NOFOLLOW);
+           statres = FSTATAT (dir->streamfd, name, &st,
+                              AT_SYMLINK_NOFOLLOW);
          else
-           statres = LXSTAT (_STAT_VER, name, &st);
+           statres = LSTAT (name, &st);
          if (statres == 0 && S_ISLNK (st.st_mode))
            flag = FTW_SLN;
          else
@@ -476,7 +476,7 @@ process_entry (struct ftw_data *data, struct dir_data *dir, const char *name,
 
 static int
 __attribute ((noinline))
-ftw_dir (struct ftw_data *data, struct STAT *st, struct dir_data *old_dir)
+ftw_dir (struct ftw_data *data, struct STRUCT_STAT *st, struct dir_data *old_dir)
 {
   struct dir_data dir;
   struct dirent64 *d;
@@ -630,7 +630,7 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
             int flags)
 {
   struct ftw_data data;
-  struct STAT st;
+  struct STRUCT_STAT st;
   int result = 0;
   int save_err;
   int cwdfd = -1;
@@ -740,12 +740,12 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
        name = data.dirbuf;
 
       if (((flags & FTW_PHYS)
-          ? LXSTAT (_STAT_VER, name, &st)
-          : XSTAT (_STAT_VER, name, &st)) < 0)
+          ? LSTAT (name, &st)
+          : STAT (name, &st)) < 0)
        {
          if (!(flags & FTW_PHYS)
              && errno == ENOENT
-             && LXSTAT (_STAT_VER, name, &st) == 0
+             && LSTAT (name, &st) == 0
              && S_ISLNK (st.st_mode))
            result = (*data.func) (data.dirbuf, &st, data.cvt_arr[FTW_SLN],
                                   &data.ftw);
index 20c43d9616d2f5a2dad6f5aa37a50b1ebe32405d..8daf8777cf1bb7bc67400c99a2b3b64539d6d257 100644 (file)
 #define NFTW_OLD_NAME __old_nftw64
 #define NFTW_NEW_NAME __new_nftw64
 #define INO_T ino64_t
-#define STAT stat64
-#define LXSTAT __lxstat64
-#define XSTAT __xstat64
-#define FXSTATAT __fxstatat64
+#define STRUCT_STAT stat64
+#define LSTAT __lstat64
+#define STAT __stat64
+#define FSTATAT __fstatat64
 #define FTW_FUNC_T __ftw64_func_t
 #define NFTW_FUNC_T __nftw64_func_t
 
index dd69e4e2813254be8ec6fe757a8aa48b51b994c7..2465b62ad25df9c294f02d9519682934d3be8904 100644 (file)
@@ -32,8 +32,8 @@ get_current_dir_name (void)
 
   pwd = getenv ("PWD");
   if (pwd != NULL
-      && stat64 (".", &dotstat) == 0
-      && stat64 (pwd, &pwdstat) == 0
+      && __stat64 (".", &dotstat) == 0
+      && __stat64 (pwd, &pwdstat) == 0
       && pwdstat.st_dev == dotstat.st_dev
       && pwdstat.st_ino == dotstat.st_ino)
     /* The PWD value is correct.  Use it.  */
index cfe01b574897aa3005ef51d61dd5042369f4dd58..094f0d7e0e96735253e84e346df9018bb3a3201c 100644 (file)
@@ -36,7 +36,7 @@ mkdirat (int fd, const char *path, mode_t mode)
     {
       /* Check FD is associated with a directory.  */
       struct stat64 st;
-      if (__fxstat64 (_STAT_VER, fd, &st) != 0)
+      if (__fstat64 (fd, &st) != 0)
        return -1;
 
       if (!S_ISDIR (st.st_mode))
index 409f55112c6518267cbf53bf1c9e5c6d02e39e43..f2af6533994415e8e608f0bcd9d2e5296aa5847b 100644 (file)
@@ -37,7 +37,7 @@ mkfifoat (int fd, const char *path, mode_t mode)
     {
       /* Check FD is associated with a directory.  */
       struct stat64 st;
-      if (__fxstat64 (_STAT_VER, fd, &st) != 0)
+      if (__fstat64 (fd, &st) != 0)
        return -1;
 
       if (!S_ISDIR (st.st_mode))
index 2f5a9f04de191f1400d82c7f4f1d996ea0e4f8c9..d810ace97954973a298654d3825c18355227609d 100644 (file)
@@ -42,7 +42,7 @@ __openat (int fd, const char *file, int oflag, ...)
     {
       /* Check FD is associated with a directory.  */
       struct stat64 st;
-      if (__fxstat64 (_STAT_VER, fd, &st) != 0)
+      if (__fstat64 (fd, &st) != 0)
        return -1;
 
       if (!S_ISDIR (st.st_mode))
index b66979c035604ab527428d095c528d43c6f04b7a..a4bb188eb2244b395c284452a1f82decab4e556e 100644 (file)
@@ -40,7 +40,7 @@ __openat64 (int fd, const char *file, int oflag, ...)
     {
       /* Check FD is associated with a directory.  */
       struct stat64 st;
-      if (__fxstat64 (_STAT_VER, fd, &st) != 0)
+      if (__fstat64 (fd, &st) != 0)
        return -1;
 
       if (!S_ISDIR (st.st_mode))
index 0e69db194090b2c0aecd022847653662161b00a7..b6c668170bfb681f56eccfee7d05d4e43f4915a3 100644 (file)
@@ -44,7 +44,7 @@ __xmknodat (int vers, int fd, const char *path, mode_t mode, dev_t *dev)
     {
       /* Check FD is associated with a directory.  */
       struct stat64 st;
-      if (__fxstat64 (_STAT_VER, fd, &st) != 0)
+      if (__fstat64 (fd, &st) != 0)
        return -1;
 
       if (!S_ISDIR (st.st_mode))
index bc76f3549f33b8cd95e6665e2efc5505961470ad..99f06efc10767453821bfddff097c680bc6b86a5 100644 (file)
@@ -1145,7 +1145,7 @@ libc_hidden_def (_IO_file_seek)
 int
 _IO_file_stat (FILE *fp, void *st)
 {
-  return __fxstat64 (_STAT_VER, fp->_fileno, (struct stat64 *) st);
+  return __fstat64 (fp->_fileno, (struct stat64 *) st);
 }
 libc_hidden_def (_IO_file_stat)
 
index ba0fe45648e111022c9b62dd82d04554d300cd54..8de6a327a4c04fcf567664ee0f1f71b9d320f184 100644 (file)
@@ -207,7 +207,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
        /* Cannot open the archive, for whatever reason.  */
        return NULL;
 
-      if (__fxstat64 (_STAT_VER, fd, &archive_stat) == -1)
+      if (__fstat64 (fd, &archive_stat) == -1)
        {
          /* stat failed, very strange.  */
        close_and_out:
@@ -405,7 +405,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
              /* Now verify we think this is really the same archive file
                 we opened before.  If it has been changed we cannot trust
                 the header we read previously.  */
-             if (__fxstat64 (_STAT_VER, fd, &st) < 0
+             if (__fstat64 (fd, &st) < 0
                  || st.st_size != archive_stat.st_size
                  || st.st_mtime != archive_stat.st_mtime
                  || st.st_dev != archive_stat.st_dev
index 2fcb348d1d686d1abab7ffcad66c558be6524dfa..82c745d9a2b52062a635d009f15341e6903108f9 100644 (file)
@@ -180,7 +180,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
     /* Cannot open the file.  */
     return;
 
-  if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) < 0)
+  if (__builtin_expect (__fstat64 (fd, &st), 0) < 0)
     {
     puntfd:
       __close_nocancel_nostatus (fd);
@@ -206,7 +206,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
       if (__builtin_expect (fd, 0) < 0)
        return;
 
-      if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) < 0)
+      if (__builtin_expect (__fstat64 (fd, &st), 0) < 0)
        goto puntfd;
     }
 
index 21e785966ac19eb8fb547971c4405187163371c3..0e688f4d7482e3359aa39dd6aa639cd882a9fd7f 100644 (file)
@@ -64,7 +64,7 @@ daemon (int nochdir, int noclose)
                struct stat64 st;
 
                if ((fd = __open_nocancel(_PATH_DEVNULL, O_RDWR, 0)) != -1
-                   && (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0)
+                   && (__builtin_expect (__fstat64 (fd, &st), 0)
                        == 0)) {
                        if (__builtin_expect (S_ISCHR (st.st_mode), 1) != 0
 #if defined DEV_NULL_MAJOR && defined DEV_NULL_MINOR
index fc2c43b771439c08119d5402b283c2b63629ad08..11f5aa83f888a1144646c4b858d6934c9f69f69c 100644 (file)
@@ -106,7 +106,7 @@ initshells (void)
        strings = NULL;
        if ((fp = fopen(_PATH_SHELLS, "rce")) == NULL)
                goto init_okshells_noclose;
-       if (fstat64(fileno(fp), &statb) == -1) {
+       if (__fstat64(fileno(fp), &statb) == -1) {
        init_okshells:
                (void)fclose(fp);
        init_okshells_noclose:
index b022cbfd9a4f69eb9f1231feae9ee35af5a822dc..05e286002b0c1ae576f0c0f4d5ae22f48026d6b4 100644 (file)
@@ -68,7 +68,7 @@ check_add_mapping (const char *name, size_t namelen, int fd, sem_t *existing)
 
   /* Get the information about the file.  */
   struct stat64 st;
-  if (__fxstat64 (_STAT_VER, fd, &st) == 0)
+  if (__fstat64 (fd, &st) == 0)
     {
       /* Get the lock.  */
       lll_lock (__sem_mappings_lock, LLL_PRIVATE);
index a4f3312f905bae850deb8b5ac0f02f6ca875f491..41c7937fcd83140b2d2b0bfb0954d5cdcfc4fd69 100644 (file)
@@ -325,7 +325,7 @@ __nscd_get_mapping (request_type type, const char *key,
   if (__glibc_unlikely (n == keylen))
     {
       struct stat64 st;
-      if (__builtin_expect (fstat64 (mapfd, &st) != 0, 0)
+      if (__builtin_expect (__fstat64 (mapfd, &st) != 0, 0)
          || __builtin_expect (st.st_size < sizeof (struct database_pers_head),
                               0))
        goto out_close;
index 4580cefb9fabc9f1b3186144a08d1ae870fc090a..b4b34945e25f43f5c29cee78c7ddcf61ed9ac6e2 100644 (file)
 # define readdir(str) __readdir64 (str)
 # define getpwnam_r(name, bufp, buf, len, res) \
     __getpwnam_r (name, bufp, buf, len, res)
-# ifndef __lstat64
-#  define __lstat64(fname, buf) __lxstat64 (_STAT_VER, fname, buf)
-# endif
-# ifndef __stat64
-#  define __stat64(fname, buf) __xstat64 (_STAT_VER, fname, buf)
-# endif
 # define struct_stat64         struct stat64
 # define FLEXIBLE_ARRAY_MEMBER
 # include <shlib-compat.h>
@@ -63,7 +57,6 @@
 # define __getlogin_r(buf, len) getlogin_r (buf, len)
 # define __lstat64(fname, buf)  lstat (fname, buf)
 # define __stat64(fname, buf)   stat (fname, buf)
-# define __fxstatat64(_, d, f, st, flag) fstatat (d, f, st, flag)
 # define struct_stat64          struct stat
 # ifndef __MVS__
 #  define __alloca              alloca
index cbd885a3c59ecbc7f5781c68a4fc5b522890e17d..3fcb399a5d20a63433f84d32d8c1137c34190071 100644 (file)
@@ -158,7 +158,7 @@ __realpath (const char *name, char *resolved)
          dest = __mempcpy (dest, start, end - start);
          *dest = '\0';
 
-         if (__lxstat64 (_STAT_VER, rpath, &st) < 0)
+         if (__lstat64 (rpath, &st) < 0)
            goto error;
 
          if (S_ISLNK (st.st_mode))
index 47b5e88498bdd3e04adff53e62348851f12b3af4..ac1fe1496ace329292b1abfc998a25fdeb13e413 100644 (file)
@@ -32,7 +32,7 @@
 #undef stat
 #define stat stat64
 #undef __stat
-#define __stat(file, buf) __xstat64 (_STAT_VER, file, buf)
+#define __stat(file, buf) __stat64 (file, buf)
 
 #define COMPILE_GLOB64 1
 
index 42b5b225caf71dc0b591f193a84f1b697e7dc1ba..32ac018fde88fbe0a46e3c556f113dc78c49efb6 100644 (file)
@@ -12,7 +12,7 @@
 #undef stat
 #define stat stat64
 #undef __stat
-#define __stat(file, buf) __xstat64 (_STAT_VER, file, buf)
+#define __stat(file, buf) __stat64 (file, buf)
 
 #define COMPILE_GLOB64 1
 
index 9627f970f90ec1063b2e75453355bf8bccf161c1..065ba2a26831ce798910cff81d0fd3ef414f6386 100644 (file)
@@ -63,7 +63,7 @@ __ptsname_internal (int fd, char *buf, size_t buflen, struct stat64 *stp)
 
   if (stp)
     {
-      if (__xstat64 (_STAT_VER, peername, stp) < 0)
+      if (__stat64 (peername, stp) < 0)
        return errno;
     }
 
index 7d1e9e495044a91dba1cb9cc962d3ea45a22995f..b3c8166701650b8b9672c7e9bdc46ddfe095ec58 100644 (file)
@@ -34,7 +34,7 @@ _dl_get_file_id (int fd, struct r_file_id *id)
 {
   struct stat64 st;
 
-  if (__glibc_unlikely (__fxstat64 (_STAT_VER, fd, &st) < 0))
+  if (__glibc_unlikely (__fstat64 (fd, &st) < 0))
     return false;
 
   id->dev = st.st_dev;
index 8a2776d5023d2c7e49c23a033eed28f5f35fa225..050d370f4cc02a658ca5ec7b038e69c039ad0ebd 100644 (file)
@@ -140,7 +140,7 @@ euidaccess (const char *path, int mode)
     return access (path, mode);
 #endif
 
-  if (stat64 (path, &stats))
+  if (__stat64 (path, &stats))
     return -1;
 
   mode &= (X_OK | W_OK | R_OK);        /* Clear any bogus bits. */
index b690f7fc885ec4b495ab492b90cb5186a61a6bb3..e424fbdaa24b5992d086762fd8fcb1941d083795 100644 (file)
@@ -29,7 +29,7 @@ __fdopendir (int fd)
 {
   struct stat64 statbuf;
 
-  if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &statbuf), 0) < 0)
+  if (__builtin_expect (__fstat64 (fd, &statbuf), 0) < 0)
     return NULL;
   if (__glibc_unlikely (! S_ISDIR (statbuf.st_mode)))
     {
index 1863be64e09638f3302fdc9b1cdc575de0c194a9..3a9fb1513f3f1bb3d87c11440f9b93dbf08321d9 100644 (file)
@@ -133,7 +133,7 @@ __fpathconf (int fd, int name)
        /* AIO is only allowed on regular files and block devices.  */
        struct stat64 st;
 
-       if (__fxstat64 (_STAT_VER, fd, &st) < 0
+       if (__fstat64 (fd, &st) < 0
            || (! S_ISREG (st.st_mode) && ! S_ISBLK (st.st_mode)))
          return -1;
        else
index ed04e564f9711298fd7bb14fd53f13c8053694d2..82c898fe35a2ce7bbfcdc79f573c07e6fe0d5eb2 100644 (file)
@@ -1785,7 +1785,7 @@ gaiconf_init (void)
   if (fp != NULL)
     {
       struct stat64 st;
-      if (__fxstat64 (_STAT_VER, fileno (fp), &st) != 0)
+      if (__fstat64 (fileno (fp), &st) != 0)
        {
          fclose (fp);
          goto no_file;
@@ -2138,7 +2138,7 @@ static void
 gaiconf_reload (void)
 {
   struct stat64 st;
-  if (__xstat64 (_STAT_VER, GAICONF_FNAME, &st) != 0
+  if (stat64 (GAICONF_FNAME, &st) != 0
       || !check_gaiconf_mtime (&st))
     gaiconf_init ();
 }
index 20c63092208de5abcf547823fc982cfb561495f4..3c63a33e889b0699d0fbbf9b1d59c4ba4f8c6fb3 100644 (file)
@@ -29,7 +29,7 @@ isfdtype (int fildes, int fdtype)
 
   {
     int save_error = errno;
-    result = fstat64 (fildes, &st);
+    result = __fstat64 (fildes, &st);
     __set_errno (save_error);
   }
 
index c6ab79246cc1d9ed8e9f2f8b647c65fafde14ad9..e89e09bfc778b70e884d06dbc070aabd1eab24d8 100644 (file)
@@ -56,7 +56,7 @@ opendir_tail (int fd)
      `stat' call.  The S_ISDIR check is superfluous if O_DIRECTORY works,
      but it's cheap and we need the stat call for st_blksize anyway.  */
   struct stat64 statbuf;
-  if (__glibc_unlikely (__fxstat64 (_STAT_VER, fd, &statbuf) < 0))
+  if (__glibc_unlikely (__fstat64 (fd, &statbuf) < 0))
     goto lose;
   if (__glibc_unlikely (! S_ISDIR (statbuf.st_mode)))
     {
index 5819f03aa7de61ddcf731cc20fd29582a8e3346c..084c5fab599ed4aa98663d5a8eb30affce59cac4 100644 (file)
@@ -131,7 +131,7 @@ __pathconf (const char *path, int name)
        /* AIO is only allowed on regular files and block devices.  */
        struct stat64 st;
 
-       if (__xstat64 (_STAT_VER, path, &st) < 0
+       if (__stat64 (path, &st) < 0
            || (! S_ISREG (st.st_mode) && ! S_ISBLK (st.st_mode)))
          return -1;
        else
index e7fccfc1c89f4de029236daa45e5f8db9499ef6b..c9cf17bc7b715698bd958bde9fa3bb2fdd5b3e62 100644 (file)
@@ -48,7 +48,7 @@ posix_fallocate (int fd, __off_t offset, __off_t len)
   }
 
   /* We have to make sure that this is really a regular file.  */
-  if (__fxstat64 (_STAT_VER, fd, &st) != 0)
+  if (__fstat64 (fd, &st) != 0)
     return EBADF;
   if (S_ISFIFO (st.st_mode))
     return ESPIPE;
index f9d4fe5ca3b33d34cbe7ef8a97edf780ee7d834b..4f8fe47b1807343b202852c0c71027cc4c3c7d35 100644 (file)
@@ -48,7 +48,7 @@ __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
   }
 
   /* We have to make sure that this is really a regular file.  */
-  if (__fxstat64 (_STAT_VER, fd, &st) != 0)
+  if (__fstat64 (fd, &st) != 0)
     return EBADF;
   if (S_ISFIFO (st.st_mode))
     return ESPIPE;
index 35ba7f810305637cbbf2fdff3f2fdb1d1dcc6983..8f7c4708df4047520d04b5a6d90a776451d25d94 100644 (file)
@@ -1216,7 +1216,7 @@ __sysconf_check_spec (const char *spec)
          spec, speclen + 1);
 
   struct stat64 st;
-  long int ret = __xstat64 (_STAT_VER, name, &st) >= 0 ? 1 : -1;
+  long int ret = __stat64 (name, &st) >= 0 ? 1 : -1;
 
   __set_errno (save_errno);
   return ret;
index cd48385a40f2400d1d8c3169c45d63c6faf8c0ee..1864c860adb94676e6cfed89a13f2aecc2aa4717 100644 (file)
@@ -65,7 +65,6 @@
 # define __getpid getpid
 # define __mkdir mkdir
 # define __open open
-# define __lxstat64(version, file, buf) lstat (file, buf)
 # define __secure_getenv secure_getenv
 #endif
 
@@ -96,7 +95,7 @@ static int
 direxists (const char *dir)
 {
   struct_stat64 buf;
-  return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode);
+  return __stat64 (dir, &buf) == 0 && S_ISDIR (buf.st_mode);
 }
 
 /* Path search algorithm, for tmpnam, tmpfile, etc.  If DIR is
@@ -251,10 +250,10 @@ __gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
 
        case __GT_NOCREATE:
          /* This case is backward from the other three.  __gen_tempname
-            succeeds if __xstat fails because the name does not exist.
+            succeeds if lstat fails because the name does not exist.
             Note the continue to bypass the common logic at the bottom
             of the loop.  */
-         if (__lxstat64 (_STAT_VER, tmpl, &st) < 0)
+         if (__lstat64 (tmpl, &st) < 0)
            {
              if (errno == ENOENT)
                {
index 56cb6dcc8b4d58d30100590d56b817fd6974f8df..b697053da1cfd36b48f20a3611fa88231e7974eb 100644 (file)
@@ -44,7 +44,7 @@ faccessat (int fd, const char *file, int mode, int flag)
     return INLINE_SYSCALL (faccessat, 3, fd, file, mode);
 
   struct stat64 stats;
-  if (__fxstatat64 (_STAT_VER, fd, file, &stats, flag & AT_SYMLINK_NOFOLLOW))
+  if (__fstatat64 (fd, file, &stats, flag & AT_SYMLINK_NOFOLLOW))
     return -1;
 
   mode &= (X_OK | W_OK | R_OK);        /* Clear any bogus bits. */
index 23c9799f5d4bc292d27770b02bcdb559719e57d6..1fe3a233336048bd1952952222aae11d2758b841 100644 (file)
@@ -60,8 +60,8 @@ fexecve (int fd, char *const argv[], char *const envp[])
 
   /* We come here only if the 'execve' call fails.  Determine whether
      /proc is mounted.  If not we return ENOSYS.  */
-  struct stat st;
-  if (stat ("/proc/self/fd", &st) != 0 && errno == ENOENT)
+  struct stat64 st;
+  if (__stat64 ("/proc/self/fd", &st) != 0 && errno == ENOENT)
     save = ENOSYS;
 
   __set_errno (save);
index a034c2d930751c261da81b462b736e4d667dda42..59bf89dc1db56db5336d0386423cbe0728db35ea 100644 (file)
@@ -31,7 +31,7 @@ libc_hidden_proto (__old_glob64);
 #undef stat
 #define stat stat64
 #undef __stat
-#define __stat(file, buf) __xstat64 (_STAT_VER, file, buf)
+#define __stat(file, buf) __stat64 (file, buf)
 
 /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC.  */
 #define GLOB_NO_LSTAT
index fec1a142e7454856fc62215e104d9e1d486084df..e59b8ab341a277a7120fd8e33b98a82e158011ec 100644 (file)
@@ -67,7 +67,7 @@ distinguish_extX (const struct statfs *fsbuf, const char *file, int fd)
   char path[PATH_MAX];
   struct stat64 st;
 
-  if ((file == NULL ? fstat64 (fd, &st) : stat64 (file, &st)) != 0)
+  if ((file == NULL ? __fstat64 (fd, &st) : __stat64 (file, &st)) != 0)
     /* Strange.  The statfd call worked, but stat fails.  Default to
        the more pessimistic value.  */
     return EXT2_LINK_MAX;
@@ -110,7 +110,7 @@ distinguish_extX (const struct statfs *fsbuf, const char *file, int fd)
            continue;
 
          struct stat64 fsst;
-         if (stat64 (mntbuf.mnt_dir, &fsst) >= 0
+         if (__stat64 (mntbuf.mnt_dir, &fsst) >= 0
              && st.st_dev == fsst.st_dev)
            {
              if (strcmp (mntbuf.mnt_type, "ext4") == 0)
index 81d9d26f1e722847c833c852cbe0a99550e16495..4c569bf264f9f0eb00d3949dc71fae2c1210a088 100644 (file)
@@ -114,7 +114,7 @@ __ptsname_internal (int fd, char *buf, size_t buflen, struct stat64 *stp)
          return ERANGE;
        }
 
-      if (__fxstat64 (_STAT_VER, fd, stp) < 0)
+      if (__fstat64 (fd, stp) < 0)
        return errno;
 
       /* Check if FD really is a master pseudo terminal.  */
@@ -138,7 +138,7 @@ __ptsname_internal (int fd, char *buf, size_t buflen, struct stat64 *stp)
       p[2] = '\0';
     }
 
-  if (__xstat64 (_STAT_VER, buf, stp) < 0)
+  if (__stat64 (buf, stp) < 0)
     return errno;
 
   /* Check if the name we're about to return really corresponds to a
index c05ca687f52273026453fd83832505279c6e9713..5fa66453538ab3954b98557fceb25eff7dd1963b 100644 (file)
@@ -84,7 +84,7 @@ getttyname (const char *dev, const struct stat64 *mytty, int save, int *dostat)
            *((char *) __mempcpy (getttyname_name, dev, devlen - 1)) = '/';
          }
        memcpy (&getttyname_name[devlen], d->d_name, dlen);
-       if (__xstat64 (_STAT_VER, getttyname_name, &st) == 0
+       if (__stat64 (getttyname_name, &st) == 0
            && is_mytty (mytty, &st))
          {
            (void) __closedir (dirstream);
@@ -125,7 +125,7 @@ ttyname (int fd)
   if (__glibc_unlikely (__tcgetattr (fd, &term) < 0))
     return NULL;
 
-  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
+  if (__fstat64 (fd, &st) < 0)
     return NULL;
 
   /* We try using the /proc filesystem.  */
@@ -162,14 +162,14 @@ ttyname (int fd)
 
       /* Verify readlink result, fall back on iterating through devices.  */
       if (ttyname_buf[0] == '/'
-         && __xstat64 (_STAT_VER, ttyname_buf, &st1) == 0
+         && __stat64 (ttyname_buf, &st1) == 0
          && is_mytty (&st, &st1))
        return ttyname_buf;
 
       doispty = 1;
     }
 
-  if (__xstat64 (_STAT_VER, "/dev/pts", &st1) == 0 && S_ISDIR (st1.st_mode))
+  if (__stat64 ("/dev/pts", &st1) == 0 && S_ISDIR (st1.st_mode))
     {
       name = getttyname ("/dev/pts", &st, save, &dostat);
     }
index 4a1ae40bb238988ae0f0bf046b6f7dcdbdbd5b53..ad8cd28158e0fbfedb164b3f94b4c18d615d3d9a 100644 (file)
@@ -71,7 +71,7 @@ getttyname_r (char *buf, size_t buflen, const struct stat64 *mytty,
        cp = __stpncpy (buf + devlen, d->d_name, needed);
        cp[0] = '\0';
 
-       if (__xstat64 (_STAT_VER, buf, &st) == 0
+       if (__stat64 (buf, &st) == 0
            && is_mytty (mytty, &st))
          {
            (void) __closedir (dirstream);
@@ -118,7 +118,7 @@ __ttyname_r (int fd, char *buf, size_t buflen)
   if (__glibc_unlikely (__tcgetattr (fd, &term) < 0))
     return errno;
 
-  if (__fxstat64 (_STAT_VER, fd, &st) < 0)
+  if (__fstat64 (fd, &st) < 0)
     return errno;
 
   /* We try using the /proc filesystem.  */
@@ -146,7 +146,7 @@ __ttyname_r (int fd, char *buf, size_t buflen)
 
       /* Verify readlink result, fall back on iterating through devices.  */
       if (buf[0] == '/'
-         && __xstat64 (_STAT_VER, buf, &st1) == 0
+         && __stat64 (buf, &st1) == 0
          && is_mytty (&st, &st1))
        return 0;
 
@@ -157,7 +157,7 @@ __ttyname_r (int fd, char *buf, size_t buflen)
   memcpy (buf, "/dev/pts/", sizeof ("/dev/pts/"));
   buflen -= sizeof ("/dev/pts/") - 1;
 
-  if (__xstat64 (_STAT_VER, buf, &st1) == 0 && S_ISDIR (st1.st_mode))
+  if (__stat64 (buf, &st1) == 0 && S_ISDIR (st1.st_mode))
     {
       ret = getttyname_r (buf, buflen, &st, save,
                          &dostat);
index 0b6dab403f5f09ca596ae7da41bd97c30f91aa4f..a65dbd520a0935e05628dbce82c4c35e9f60532b 100644 (file)
@@ -25,7 +25,7 @@ ftok (const char *pathname, int proj_id)
   struct stat64 st;
   key_t key;
 
-  if (__xstat64 (_STAT_VER, pathname, &st) < 0)
+  if (__stat64 (pathname, &st) < 0)
     return (key_t) -1;
 
   key = ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16)
index d5c01b84460ab02537127e5f87fdc5c914b8ad13..ddd97ba2778afc91918202dfcf5689850d53981c 100644 (file)
@@ -121,7 +121,7 @@ __getdate_r (const char *string, struct tm *tp)
   if (datemsk == NULL || *datemsk == '\0')
     return 1;
 
-  if (stat64 (datemsk, &st) < 0)
+  if (__stat64 (datemsk, &st) < 0)
     return 3;
 
   if (!S_ISREG (st.st_mode))
index af6da1bf0087de06c467f4c17f9046ce283c2d6d..e8084a86e854aea6da198d823e7ed918df34ca37 100644 (file)
@@ -152,7 +152,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
   /* If we were already using tzfile, check whether the file changed.  */
   struct stat64 st;
   if (was_using_tzfile
-      && stat64 (file, &st) == 0
+      && __stat64 (file, &st) == 0
       && tzfile_ino == st.st_ino && tzfile_dev == st.st_dev
       && tzfile_mtime == st.st_mtime)
     goto done;  /* Nothing to do.  */
@@ -164,7 +164,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
     goto ret_free_transitions;
 
   /* Get information about the file we are actually using.  */
-  if (fstat64 (__fileno (f), &st) != 0)
+  if (__fstat64 (__fileno (f), &st) != 0)
     goto lose;
 
   free ((void *) transitions);