From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 0BAAD1F5AE for ; Fri, 24 Jul 2020 09:16:34 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2871C388E831; Fri, 24 Jul 2020 09:16:33 +0000 (GMT) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by sourceware.org (Postfix) with ESMTPS id 789623857C71 for ; Fri, 24 Jul 2020 09:16:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 789623857C71 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4BCk8p4RQXz1qs0J; Fri, 24 Jul 2020 11:16:26 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4BCk8p41Wvz1qy6J; Fri, 24 Jul 2020 11:16:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id lH64SaFNONdY; Fri, 24 Jul 2020 11:16:22 +0200 (CEST) X-Auth-Info: SNlyJzzPbRnLnpSZ8dxTTJlZaPxYebtHUa3HctS+RmA= Received: from jawa (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 24 Jul 2020 11:16:22 +0200 (CEST) Date: Fri, 24 Jul 2020 11:16:21 +0200 From: Lukasz Majewski To: Adhemerval Zanella Subject: Re: [PATCH 08/16] Remove internal usage of extensible stat functions Message-ID: <20200724111621.617fcdac@jawa> In-Reply-To: <20200723194641.1949404-9-adhemerval.zanella@linaro.org> References: <20200723194641.1949404-1-adhemerval.zanella@linaro.org> <20200723194641.1949404-9-adhemerval.zanella@linaro.org> Organization: denx.de X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/X7IW_0.G6aHH4WozYjB0NYR"; protocol="application/pgp-signature" X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" --Sig_/X7IW_0.G6aHH4WozYjB0NYR Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 23 Jul 2020 16:46:33 -0300 Adhemerval Zanella wrote: > 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. >=20 > Checked with a build for all affected ABIs. I also check on > x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Lukasz Majewski > --- > catgets/open_catalog.c | 2 +- > csu/check_fds.c | 2 +- > elf/cache.c | 4 +-- > elf/dl-load.c | 4 +-- > elf/dl-misc.c | 2 +- > elf/dl-profile.c | 2 +- > iconv/gconv_cache.c | 2 +- > include/sys/stat.h | 1 + > inet/rcmd.c | 4 +-- > inet/ruserpass.c | 2 +- > intl/loadmsgcat.c | 2 +- > io/file_change_detection.c | 4 +-- > io/fts.c | 15 +++++----- > io/fts64.c | 5 ++-- > io/ftw.c | 46 > ++++++++++++++--------------- io/ftw64.c | > 8 ++--- io/getdirname.c | 4 +-- > io/mkdirat.c | 2 +- > io/mkfifoat.c | 2 +- > io/openat.c | 2 +- > io/openat64.c | 2 +- > io/xmknodat.c | 2 +- > libio/fileops.c | 2 +- > locale/loadarchive.c | 4 +-- > locale/loadlocale.c | 4 +-- > misc/daemon.c | 2 +- > misc/getusershell.c | 2 +- > nptl/sem_open.c | 2 +- > nscd/nscd_helper.c | 2 +- > posix/glob.c | 7 ----- > stdlib/canonicalize.c | 2 +- > sysdeps/gnu/glob64-lstat-compat.c | 2 +- > sysdeps/gnu/glob64.c | 2 +- > sysdeps/mach/hurd/ptsname.c | 2 +- > sysdeps/posix/dl-fileid.h | 2 +- > sysdeps/posix/euidaccess.c | 2 +- > sysdeps/posix/fdopendir.c | 2 +- > sysdeps/posix/fpathconf.c | 2 +- > sysdeps/posix/getaddrinfo.c | 4 +-- > sysdeps/posix/isfdtype.c | 2 +- > sysdeps/posix/opendir.c | 2 +- > sysdeps/posix/pathconf.c | 2 +- > sysdeps/posix/posix_fallocate.c | 2 +- > sysdeps/posix/posix_fallocate64.c | 2 +- > sysdeps/posix/sysconf.c | 2 +- > sysdeps/posix/tempname.c | 5 ++-- > sysdeps/unix/sysv/linux/faccessat.c | 2 +- > sysdeps/unix/sysv/linux/fexecve.c | 4 +-- > sysdeps/unix/sysv/linux/oldglob.c | 2 +- > sysdeps/unix/sysv/linux/pathconf.c | 4 +-- > sysdeps/unix/sysv/linux/ptsname.c | 4 +-- > sysdeps/unix/sysv/linux/ttyname.c | 8 ++--- > sysdeps/unix/sysv/linux/ttyname_r.c | 8 ++--- > sysvipc/ftok.c | 2 +- > time/getdate.c | 2 +- > time/tzfile.c | 4 +-- > 56 files changed, 108 insertions(+), 113 deletions(-) >=20 > diff --git a/catgets/open_catalog.c b/catgets/open_catalog.c > index 6b14963d78..cf8d635ae7 100644 > --- a/catgets/open_catalog.c > +++ b/catgets/open_catalog.c > @@ -194,7 +194,7 @@ __open_catalog (const char *cat_name, const char > *nlspath, const char *env_var, return -1; > } > =20 > - if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) < 0) > + if (__builtin_expect (__fstat64 (fd, &st), 0) < 0) > goto close_unlock_return; > =20 > if (__builtin_expect (!S_ISREG (st.st_mode), 0) > diff --git a/csu/check_fds.c b/csu/check_fds.c > index 30634b81a7..29d9d04acb 100644 > --- a/csu/check_fds.c > +++ b/csu/check_fds.c > @@ -71,7 +71,7 @@ check_one_fd (int fd, int mode) > decsriptor numbers, in this order. */ > struct stat64 st; > if (__builtin_expect (nullfd !=3D fd, 0) > - || __builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) > !=3D 0 > + || __builtin_expect (__fstat64 (fd, &st), 0) !=3D 0 > || __builtin_expect (S_ISCHR (st.st_mode), 1) =3D=3D 0 > || st.st_rdev !=3D dev) > /* We cannot even give an error message here since it would > diff --git a/elf/cache.c b/elf/cache.c > index d92b4e59c1..1eb1455883 100644 > --- a/elf/cache.c > +++ b/elf/cache.c > @@ -163,7 +163,7 @@ print_cache (const char *cache_name) > error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"), > cache_name);=20 > 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 =3D=3D 0) > { > @@ -699,7 +699,7 @@ load_aux_cache (const char *aux_cache_name) > } > =20 > 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 (); > diff --git a/elf/dl-load.c b/elf/dl-load.c > index e39980fb19..646c5dca40 100644 > --- a/elf/dl-load.c > +++ b/elf/dl-load.c > @@ -1914,7 +1914,7 @@ open_path (const char *name, size_t namelen, > int mode,=20 > buf[buflen - namelen - 1] =3D '\0'; > =20 > - if (__xstat64 (_STAT_VER, buf, &st) !=3D 0 > + if (__stat64 (buf, &st) !=3D 0 > || ! S_ISDIR (st.st_mode)) > /* The directory does not exist or it is no > directory. */ this_dir->status[cnt] =3D nonexisting; > @@ -1934,7 +1934,7 @@ open_path (const char *name, size_t namelen, > int mode, directories and so exploit the bugs. */ > struct stat64 st; > =20 > - if (__fxstat64 (_STAT_VER, fd, &st) !=3D 0 > + if (__fstat64 (fd, &st) !=3D 0 > || (st.st_mode & S_ISUID) =3D=3D 0) > { > /* The shared object cannot be tested for being > SUID diff --git a/elf/dl-misc.c b/elf/dl-misc.c > index f9d1fd7993..aee62e1e60 100644 > --- a/elf/dl-misc.c > +++ b/elf/dl-misc.c > @@ -47,7 +47,7 @@ _dl_sysdep_read_whole_file (const char *file, > size_t *sizep, int prot) int fd =3D __open64_nocancel (file, O_RDONLY | > O_CLOEXEC); if (fd >=3D 0) > { > - if (__fxstat64 (_STAT_VER, fd, &st) >=3D 0) > + if (__fstat64 (fd, &st) >=3D 0) > { > *sizep =3D st.st_size; > =20 > diff --git a/elf/dl-profile.c b/elf/dl-profile.c > index c681f5415c..89dd70ba3b 100644 > --- a/elf/dl-profile.c > +++ b/elf/dl-profile.c > @@ -342,7 +342,7 @@ _dl_start_profile (void) > return; > } > =20 > - 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 =3D> don't use it. */ > errstr =3D "%s: cannot stat file: %s\n"; > diff --git a/iconv/gconv_cache.c b/iconv/gconv_cache.c > index 9fe371b4c0..b326cd19e2 100644 > --- a/iconv/gconv_cache.c > +++ b/iconv/gconv_cache.c > @@ -64,7 +64,7 @@ __gconv_load_cache (void) > return -1; > =20 > /* 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)) > diff --git a/include/sys/stat.h b/include/sys/stat.h > index 92284ca48b..f8847cf73e 100644 > --- a/include/sys/stat.h > +++ b/include/sys/stat.h > @@ -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) > diff --git a/inet/rcmd.c b/inet/rcmd.c > index 8a9616f847..452ff7d099 100644 > --- a/inet/rcmd.c > +++ b/inet/rcmd.c > @@ -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 =3D _("lstat failed"); > else if (!S_ISREG (st.st_mode)) > cp =3D _("not regular file"); > @@ -483,7 +483,7 @@ iruserfopen (const char *file, uid_t okuser) > res =3D fopen (file, "rce"); > if (!res) > cp =3D _("cannot open"); > - else if (__fxstat64 (_STAT_VER, fileno (res), &st) < 0) > + else if (__fstat64 (fileno (res), &st) < 0) > cp =3D _("fstat failed"); > else if (st.st_uid && st.st_uid !=3D okuser) > cp =3D _("bad owner"); > diff --git a/inet/ruserpass.c b/inet/ruserpass.c > index 4fa6520c1a..d61a72877d 100644 > --- a/inet/ruserpass.c > +++ b/inet/ruserpass.c > @@ -174,7 +174,7 @@ next: > break; > case PASSWD: > if (strcmp(*aname, "anonymous") && > - fstat64(fileno(cfile), &stb) >=3D 0 && > + __fstat64(fileno(cfile), &stb) >=3D 0 && > (stb.st_mode & 077) !=3D 0) { > warnx(_("Error: .netrc file is readable by others.")); > warnx(_("Remove 'password' line or make file unreadable by > others.")); diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c > index 91c1ef156a..d44a4a0b14 100644 > --- a/intl/loadmsgcat.c > +++ b/intl/loadmsgcat.c > @@ -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) !=3D 0, 0) > + __builtin_expect (__fstat64 (fd, &st) !=3D 0, 0) > #else > __builtin_expect (fstat (fd, &st) !=3D 0, 0) > #endif > diff --git a/io/file_change_detection.c b/io/file_change_detection.c > index c6d700ed05..f52d8fecfa 100644 > --- a/io/file_change_detection.c > +++ b/io/file_change_detection.c > @@ -67,7 +67,7 @@ __file_change_detection_for_path (struct > file_change_detection *file, const char *path) > { > struct stat64 st; > - if (stat64 (path, &st) !=3D 0) > + if (__stat64 (path, &st) !=3D 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) !=3D 0) > + if (__fstat64 (__fileno (fp), &st) !=3D 0) > /* If we already have a file descriptor, all errors are > fatal. */ return false; > else > diff --git a/io/fts.c b/io/fts.c > index ba83691859..9668a205c3 100644 > --- a/io/fts.c > +++ b/io/fts.c > @@ -81,8 +81,9 @@ static char sccsid[] =3D "@(#)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 > =20 > 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; > =20 > /* 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 =3D errno; > -err: memset(sbp, 0, sizeof(struct STAT)); > +err: memset(sbp, 0, sizeof(struct STRUCT_STAT)); > return (FTS_NS); > } > =20 > @@ -996,7 +997,7 @@ fts_alloc (FTSOBJ *sp, const char *name, size_t > namelen) */ > len =3D sizeof(FTSENTRY) + namelen; > if (!ISSET(FTS_NOSTAT)) > - len +=3D sizeof(struct STAT) + ALIGNBYTES; > + len +=3D sizeof(struct STRUCT_STAT) + ALIGNBYTES; > if ((p =3D malloc(len)) =3D=3D NULL) > return (NULL); > =20 > @@ -1005,7 +1006,7 @@ fts_alloc (FTSOBJ *sp, const char *name, size_t > namelen) p->fts_name[namelen] =3D '\0'; > =20 > if (!ISSET(FTS_NOSTAT)) > - p->fts_statp =3D (struct STAT *)ALIGN(p->fts_name + > namelen + 2); > + p->fts_statp =3D (struct STRUCT_STAT > *)ALIGN(p->fts_name + namelen + 2); p->fts_namelen =3D namelen; > p->fts_path =3D sp->fts_path; > p->fts_errno =3D 0; > @@ -1116,7 +1117,7 @@ fts_safe_changedir (FTSOBJ *sp, FTSENTRY *p, > int fd, const char *path) return (0); > if (fd < 0 && (newfd =3D __open(path, O_RDONLY, 0)) < 0) > return (-1); > - if (__fxstat64(_STAT_VER, newfd, &sb)) { > + if (__fstat64(newfd, &sb)) { > ret =3D -1; > goto bail; > } > diff --git a/io/fts64.c b/io/fts64.c > index 3d9c779791..466703da37 100644 > --- a/io/fts64.c > +++ b/io/fts64.c > @@ -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 > =20 > #include "fts.c" > diff --git a/io/ftw.c b/io/ftw.c > index 8c79d29a9e..7104816e85 100644 > --- 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[] =3D > =20 > =20 > /* 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); > =20 > =20 > @@ -239,7 +239,7 @@ object_compare (const void *p1, const void *p2) > =20 > =20 > 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 =3D malloc (sizeof (struct known_object)); > if (newp =3D=3D NULL) > @@ -251,7 +251,7 @@ add_object (struct ftw_data *data, struct STAT > *st)=20 > =20 > 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 =3D 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 =3D 0; > int flag =3D 0; > size_t new_buflen; > @@ -405,16 +405,16 @@ process_entry (struct ftw_data *data, struct > dir_data *dir, const char *name,=20 > int statres; > if (dir->streamfd !=3D -1) > - statres =3D FXSTATAT (_STAT_VER, dir->streamfd, name, &st, > - (data->flags & FTW_PHYS) ? > AT_SYMLINK_NOFOLLOW : 0); > + statres =3D FSTATAT (dir->streamfd, name, &st, > + (data->flags & FTW_PHYS) ? > AT_SYMLINK_NOFOLLOW : 0); else > { > if ((data->flags & FTW_CHDIR) =3D=3D 0) > name =3D data->dirbuf; > =20 > statres =3D ((data->flags & FTW_PHYS) > - ? LXSTAT (_STAT_VER, name, &st) > - : XSTAT (_STAT_VER, name, &st)); > + ? LSTAT (name, &st) > + : STAT (name, &st)); > } > =20 > 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 !=3D -1) > - statres =3D FXSTATAT (_STAT_VER, dir->streamfd, name, &st, > - AT_SYMLINK_NOFOLLOW); > + statres =3D FSTATAT (dir->streamfd, name, &st, > + AT_SYMLINK_NOFOLLOW); > else > - statres =3D LXSTAT (_STAT_VER, name, &st); > + statres =3D LSTAT (name, &st); > if (statres =3D=3D 0 && S_ISLNK (st.st_mode)) > flag =3D FTW_SLN; > else > @@ -476,7 +476,7 @@ process_entry (struct ftw_data *data, struct > dir_data *dir, const char *name,=20 > 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 =3D 0; > int save_err; > int cwdfd =3D -1; > @@ -740,12 +740,12 @@ ftw_startup (const char *dir, int is_nftw, void > *func, int descriptors, name =3D data.dirbuf; > =20 > 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 =3D=3D ENOENT > - && LXSTAT (_STAT_VER, name, &st) =3D=3D 0 > + && LSTAT (name, &st) =3D=3D 0 > && S_ISLNK (st.st_mode)) > result =3D (*data.func) (data.dirbuf, &st, > data.cvt_arr[FTW_SLN], &data.ftw); > diff --git a/io/ftw64.c b/io/ftw64.c > index 20c43d9616..8daf8777cf 100644 > --- a/io/ftw64.c > +++ b/io/ftw64.c > @@ -22,10 +22,10 @@ > #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 > =20 > diff --git a/io/getdirname.c b/io/getdirname.c > index dd69e4e281..2465b62ad2 100644 > --- a/io/getdirname.c > +++ b/io/getdirname.c > @@ -32,8 +32,8 @@ get_current_dir_name (void) > =20 > pwd =3D getenv ("PWD"); > if (pwd !=3D NULL > - && stat64 (".", &dotstat) =3D=3D 0 > - && stat64 (pwd, &pwdstat) =3D=3D 0 > + && __stat64 (".", &dotstat) =3D=3D 0 > + && __stat64 (pwd, &pwdstat) =3D=3D 0 > && pwdstat.st_dev =3D=3D dotstat.st_dev > && pwdstat.st_ino =3D=3D dotstat.st_ino) > /* The PWD value is correct. Use it. */ > diff --git a/io/mkdirat.c b/io/mkdirat.c > index cfe01b5748..094f0d7e0e 100644 > --- a/io/mkdirat.c > +++ b/io/mkdirat.c > @@ -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) !=3D 0) > + if (__fstat64 (fd, &st) !=3D 0) > return -1; > =20 > if (!S_ISDIR (st.st_mode)) > diff --git a/io/mkfifoat.c b/io/mkfifoat.c > index 409f55112c..f2af653399 100644 > --- a/io/mkfifoat.c > +++ b/io/mkfifoat.c > @@ -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) !=3D 0) > + if (__fstat64 (fd, &st) !=3D 0) > return -1; > =20 > if (!S_ISDIR (st.st_mode)) > diff --git a/io/openat.c b/io/openat.c > index a7ce65bee2..a2e86eddeb 100644 > --- a/io/openat.c > +++ b/io/openat.c > @@ -47,7 +47,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) !=3D 0) > + if (__fstat64 (fd, &st) !=3D 0) > return -1; > =20 > if (!S_ISDIR (st.st_mode)) > diff --git a/io/openat64.c b/io/openat64.c > index b66979c035..a4bb188eb2 100644 > --- a/io/openat64.c > +++ b/io/openat64.c > @@ -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) !=3D 0) > + if (__fstat64 (fd, &st) !=3D 0) > return -1; > =20 > if (!S_ISDIR (st.st_mode)) > diff --git a/io/xmknodat.c b/io/xmknodat.c > index 0e69db1940..b6c668170b 100644 > --- a/io/xmknodat.c > +++ b/io/xmknodat.c > @@ -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) !=3D 0) > + if (__fstat64 (fd, &st) !=3D 0) > return -1; > =20 > if (!S_ISDIR (st.st_mode)) > diff --git a/libio/fileops.c b/libio/fileops.c > index bc76f3549f..99f06efc10 100644 > --- a/libio/fileops.c > +++ b/libio/fileops.c > @@ -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) > =20 > diff --git a/locale/loadarchive.c b/locale/loadarchive.c > index ba0fe45648..8de6a327a4 100644 > --- a/locale/loadarchive.c > +++ b/locale/loadarchive.c > @@ -207,7 +207,7 @@ _nl_load_locale_from_archive (int category, const > char **namep) /* Cannot open the archive, for whatever reason. */ > return NULL; > =20 > - if (__fxstat64 (_STAT_VER, fd, &archive_stat) =3D=3D -1) > + if (__fstat64 (fd, &archive_stat) =3D=3D -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 !=3D archive_stat.st_size > || st.st_mtime !=3D archive_stat.st_mtime > || st.st_dev !=3D archive_stat.st_dev > diff --git a/locale/loadlocale.c b/locale/loadlocale.c > index 2fcb348d1d..82c745d9a2 100644 > --- a/locale/loadlocale.c > +++ b/locale/loadlocale.c > @@ -180,7 +180,7 @@ _nl_load_locale (struct loaded_l10nfile *file, > int category) /* Cannot open the file. */ > return; > =20 > - 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; > =20 > - if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) < 0) > + if (__builtin_expect (__fstat64 (fd, &st), 0) < 0) > goto puntfd; > } > =20 > diff --git a/misc/daemon.c b/misc/daemon.c > index 21e785966a..0e688f4d74 100644 > --- a/misc/daemon.c > +++ b/misc/daemon.c > @@ -64,7 +64,7 @@ daemon (int nochdir, int noclose) > struct stat64 st; > =20 > if ((fd =3D __open_nocancel(_PATH_DEVNULL, O_RDWR, 0)) > !=3D -1 > - && (__builtin_expect (__fxstat64 (_STAT_VER, fd, > &st), 0) > + && (__builtin_expect (__fstat64 (fd, &st), 0) > =3D=3D 0)) { > if (__builtin_expect (S_ISCHR (st.st_mode), > 1) !=3D 0 #if defined DEV_NULL_MAJOR && defined DEV_NULL_MINOR > diff --git a/misc/getusershell.c b/misc/getusershell.c > index fc2c43b771..11f5aa83f8 100644 > --- a/misc/getusershell.c > +++ b/misc/getusershell.c > @@ -106,7 +106,7 @@ initshells (void) > strings =3D NULL; > if ((fp =3D fopen(_PATH_SHELLS, "rce")) =3D=3D NULL) > goto init_okshells_noclose; > - if (fstat64(fileno(fp), &statb) =3D=3D -1) { > + if (__fstat64(fileno(fp), &statb) =3D=3D -1) { > init_okshells: > (void)fclose(fp); > init_okshells_noclose: > diff --git a/nptl/sem_open.c b/nptl/sem_open.c > index b022cbfd9a..05e286002b 100644 > --- a/nptl/sem_open.c > +++ b/nptl/sem_open.c > @@ -68,7 +68,7 @@ check_add_mapping (const char *name, size_t > namelen, int fd, sem_t *existing)=20 > /* Get the information about the file. */ > struct stat64 st; > - if (__fxstat64 (_STAT_VER, fd, &st) =3D=3D 0) > + if (__fstat64 (fd, &st) =3D=3D 0) > { > /* Get the lock. */ > lll_lock (__sem_mappings_lock, LLL_PRIVATE); > diff --git a/nscd/nscd_helper.c b/nscd/nscd_helper.c > index a4f3312f90..41c7937fcd 100644 > --- a/nscd/nscd_helper.c > +++ b/nscd/nscd_helper.c > @@ -325,7 +325,7 @@ __nscd_get_mapping (request_type type, const char > *key, if (__glibc_unlikely (n =3D=3D keylen)) > { > struct stat64 st; > - if (__builtin_expect (fstat64 (mapfd, &st) !=3D 0, 0) > + if (__builtin_expect (__fstat64 (mapfd, &st) !=3D 0, 0) > || __builtin_expect (st.st_size < sizeof (struct > database_pers_head), 0)) > goto out_close; > diff --git a/posix/glob.c b/posix/glob.c > index 4580cefb9f..b4b34945e2 100644 > --- a/posix/glob.c > +++ b/posix/glob.c > @@ -49,12 +49,6 @@ > # 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 > @@ -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 > diff --git a/stdlib/canonicalize.c b/stdlib/canonicalize.c > index cbd885a3c5..3fcb399a5d 100644 > --- a/stdlib/canonicalize.c > +++ b/stdlib/canonicalize.c > @@ -158,7 +158,7 @@ __realpath (const char *name, char *resolved) > dest =3D __mempcpy (dest, start, end - start); > *dest =3D '\0'; > =20 > - if (__lxstat64 (_STAT_VER, rpath, &st) < 0) > + if (__lstat64 (rpath, &st) < 0) > goto error; > =20 > if (S_ISLNK (st.st_mode)) > diff --git a/sysdeps/gnu/glob64-lstat-compat.c > b/sysdeps/gnu/glob64-lstat-compat.c index 47b5e88498..ac1fe1496a > 100644 --- a/sysdeps/gnu/glob64-lstat-compat.c > +++ b/sysdeps/gnu/glob64-lstat-compat.c > @@ -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) > =20 > #define COMPILE_GLOB64 1 > =20 > diff --git a/sysdeps/gnu/glob64.c b/sysdeps/gnu/glob64.c > index 42b5b225ca..32ac018fde 100644 > --- a/sysdeps/gnu/glob64.c > +++ b/sysdeps/gnu/glob64.c > @@ -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) > =20 > #define COMPILE_GLOB64 1 > =20 > diff --git a/sysdeps/mach/hurd/ptsname.c b/sysdeps/mach/hurd/ptsname.c > index 9627f970f9..065ba2a268 100644 > --- a/sysdeps/mach/hurd/ptsname.c > +++ b/sysdeps/mach/hurd/ptsname.c > @@ -63,7 +63,7 @@ __ptsname_internal (int fd, char *buf, size_t > buflen, struct stat64 *stp)=20 > if (stp) > { > - if (__xstat64 (_STAT_VER, peername, stp) < 0) > + if (__stat64 (peername, stp) < 0) > return errno; > } > =20 > diff --git a/sysdeps/posix/dl-fileid.h b/sysdeps/posix/dl-fileid.h > index 7d1e9e4950..b3c8166701 100644 > --- a/sysdeps/posix/dl-fileid.h > +++ b/sysdeps/posix/dl-fileid.h > @@ -34,7 +34,7 @@ _dl_get_file_id (int fd, struct r_file_id *id) > { > struct stat64 st; > =20 > - if (__glibc_unlikely (__fxstat64 (_STAT_VER, fd, &st) < 0)) > + if (__glibc_unlikely (__fstat64 (fd, &st) < 0)) > return false; > =20 > id->dev =3D st.st_dev; > diff --git a/sysdeps/posix/euidaccess.c b/sysdeps/posix/euidaccess.c > index 8a2776d502..050d370f4c 100644 > --- a/sysdeps/posix/euidaccess.c > +++ b/sysdeps/posix/euidaccess.c > @@ -140,7 +140,7 @@ euidaccess (const char *path, int mode) > return access (path, mode); > #endif > =20 > - if (stat64 (path, &stats)) > + if (__stat64 (path, &stats)) > return -1; > =20 > mode &=3D (X_OK | W_OK | R_OK); /* Clear any bogus bits. */ > diff --git a/sysdeps/posix/fdopendir.c b/sysdeps/posix/fdopendir.c > index b690f7fc88..e424fbdaa2 100644 > --- a/sysdeps/posix/fdopendir.c > +++ b/sysdeps/posix/fdopendir.c > @@ -29,7 +29,7 @@ __fdopendir (int fd) > { > struct stat64 statbuf; > =20 > - 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))) > { > diff --git a/sysdeps/posix/fpathconf.c b/sysdeps/posix/fpathconf.c > index 1863be64e0..3a9fb1513f 100644 > --- a/sysdeps/posix/fpathconf.c > +++ b/sysdeps/posix/fpathconf.c > @@ -133,7 +133,7 @@ __fpathconf (int fd, int name) > /* AIO is only allowed on regular files and block devices. > */ struct stat64 st; > =20 > - 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 > diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c > index ed04e564f9..82c898fe35 100644 > --- a/sysdeps/posix/getaddrinfo.c > +++ b/sysdeps/posix/getaddrinfo.c > @@ -1785,7 +1785,7 @@ gaiconf_init (void) > if (fp !=3D NULL) > { > struct stat64 st; > - if (__fxstat64 (_STAT_VER, fileno (fp), &st) !=3D 0) > + if (__fstat64 (fileno (fp), &st) !=3D 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) !=3D 0 > + if (stat64 (GAICONF_FNAME, &st) !=3D 0 > || !check_gaiconf_mtime (&st)) > gaiconf_init (); > } > diff --git a/sysdeps/posix/isfdtype.c b/sysdeps/posix/isfdtype.c > index 20c6309220..3c63a33e88 100644 > --- a/sysdeps/posix/isfdtype.c > +++ b/sysdeps/posix/isfdtype.c > @@ -29,7 +29,7 @@ isfdtype (int fildes, int fdtype) > =20 > { > int save_error =3D errno; > - result =3D fstat64 (fildes, &st); > + result =3D __fstat64 (fildes, &st); > __set_errno (save_error); > } > =20 > diff --git a/sysdeps/posix/opendir.c b/sysdeps/posix/opendir.c > index c6ab79246c..e89e09bfc7 100644 > --- a/sysdeps/posix/opendir.c > +++ b/sysdeps/posix/opendir.c > @@ -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))) > { > diff --git a/sysdeps/posix/pathconf.c b/sysdeps/posix/pathconf.c > index 5819f03aa7..084c5fab59 100644 > --- a/sysdeps/posix/pathconf.c > +++ b/sysdeps/posix/pathconf.c > @@ -131,7 +131,7 @@ __pathconf (const char *path, int name) > /* AIO is only allowed on regular files and block devices. > */ struct stat64 st; > =20 > - 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 > diff --git a/sysdeps/posix/posix_fallocate.c > b/sysdeps/posix/posix_fallocate.c index e7fccfc1c8..c9cf17bc7b 100644 > --- a/sysdeps/posix/posix_fallocate.c > +++ b/sysdeps/posix/posix_fallocate.c > @@ -48,7 +48,7 @@ posix_fallocate (int fd, __off_t offset, __off_t > len) } > =20 > /* We have to make sure that this is really a regular file. */ > - if (__fxstat64 (_STAT_VER, fd, &st) !=3D 0) > + if (__fstat64 (fd, &st) !=3D 0) > return EBADF; > if (S_ISFIFO (st.st_mode)) > return ESPIPE; > diff --git a/sysdeps/posix/posix_fallocate64.c > b/sysdeps/posix/posix_fallocate64.c index f9d4fe5ca3..4f8fe47b18 > 100644 --- a/sysdeps/posix/posix_fallocate64.c > +++ b/sysdeps/posix/posix_fallocate64.c > @@ -48,7 +48,7 @@ __posix_fallocate64_l64 (int fd, __off64_t offset, > __off64_t len) } > =20 > /* We have to make sure that this is really a regular file. */ > - if (__fxstat64 (_STAT_VER, fd, &st) !=3D 0) > + if (__fstat64 (fd, &st) !=3D 0) > return EBADF; > if (S_ISFIFO (st.st_mode)) > return ESPIPE; > diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c > index 35ba7f8103..8f7c4708df 100644 > --- a/sysdeps/posix/sysconf.c > +++ b/sysdeps/posix/sysconf.c > @@ -1216,7 +1216,7 @@ __sysconf_check_spec (const char *spec) > spec, speclen + 1); > =20 > struct stat64 st; > - long int ret =3D __xstat64 (_STAT_VER, name, &st) >=3D 0 ? 1 : -1; > + long int ret =3D __stat64 (name, &st) >=3D 0 ? 1 : -1; > =20 > __set_errno (save_errno); > return ret; > diff --git a/sysdeps/posix/tempname.c b/sysdeps/posix/tempname.c > index cd48385a40..3dd8f1e1ef 100644 > --- a/sysdeps/posix/tempname.c > +++ b/sysdeps/posix/tempname.c > @@ -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 > =20 > @@ -96,7 +95,7 @@ static int > direxists (const char *dir) > { > struct_stat64 buf; > - return __xstat64 (_STAT_VER, dir, &buf) =3D=3D 0 && S_ISDIR > (buf.st_mode); > + return __stat64 (dir, &buf) =3D=3D 0 && S_ISDIR (buf.st_mode); > } > =20 > /* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is > @@ -254,7 +253,7 @@ __gen_tempname (char *tmpl, int suffixlen, int > flags, int kind) succeeds if __xstat 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 =3D=3D ENOENT) > { > diff --git a/sysdeps/unix/sysv/linux/faccessat.c > b/sysdeps/unix/sysv/linux/faccessat.c index e4f18ab2db..5a660f5201 > 100644 --- a/sysdeps/unix/sysv/linux/faccessat.c > +++ b/sysdeps/unix/sysv/linux/faccessat.c > @@ -37,7 +37,7 @@ faccessat (int fd, const char *file, int mode, int > flag) return INLINE_SYSCALL (faccessat, 3, fd, file, mode); > =20 > 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; > =20 > mode &=3D (X_OK | W_OK | R_OK); /* Clear any bogus bits. */ > diff --git a/sysdeps/unix/sysv/linux/fexecve.c > b/sysdeps/unix/sysv/linux/fexecve.c index 23c9799f5d..1fe3a23333 > 100644 --- a/sysdeps/unix/sysv/linux/fexecve.c > +++ b/sysdeps/unix/sysv/linux/fexecve.c > @@ -60,8 +60,8 @@ fexecve (int fd, char *const argv[], char *const > envp[])=20 > /* 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) !=3D 0 && errno =3D=3D ENOENT) > + struct stat64 st; > + if (__stat64 ("/proc/self/fd", &st) !=3D 0 && errno =3D=3D ENOENT) > save =3D ENOSYS; > =20 > __set_errno (save); > diff --git a/sysdeps/unix/sysv/linux/oldglob.c > b/sysdeps/unix/sysv/linux/oldglob.c index a034c2d930..59bf89dc1d > 100644 --- a/sysdeps/unix/sysv/linux/oldglob.c > +++ b/sysdeps/unix/sysv/linux/oldglob.c > @@ -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) > =20 > /* Avoid calling gl_lstat with GLOB_ALTDIRFUNC. */ > #define GLOB_NO_LSTAT > diff --git a/sysdeps/unix/sysv/linux/pathconf.c > b/sysdeps/unix/sysv/linux/pathconf.c index fec1a142e7..e59b8ab341 > 100644 --- a/sysdeps/unix/sysv/linux/pathconf.c > +++ b/sysdeps/unix/sysv/linux/pathconf.c > @@ -67,7 +67,7 @@ distinguish_extX (const struct statfs *fsbuf, const > char *file, int fd) char path[PATH_MAX]; > struct stat64 st; > =20 > - if ((file =3D=3D NULL ? fstat64 (fd, &st) : stat64 (file, &st)) !=3D 0) > + if ((file =3D=3D NULL ? __fstat64 (fd, &st) : __stat64 (file, &st)) != =3D > 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; > =20 > struct stat64 fsst; > - if (stat64 (mntbuf.mnt_dir, &fsst) >=3D 0 > + if (__stat64 (mntbuf.mnt_dir, &fsst) >=3D 0 > && st.st_dev =3D=3D fsst.st_dev) > { > if (strcmp (mntbuf.mnt_type, "ext4") =3D=3D 0) > diff --git a/sysdeps/unix/sysv/linux/ptsname.c > b/sysdeps/unix/sysv/linux/ptsname.c index 81d9d26f1e..4c569bf264 > 100644 --- a/sysdeps/unix/sysv/linux/ptsname.c > +++ b/sysdeps/unix/sysv/linux/ptsname.c > @@ -114,7 +114,7 @@ __ptsname_internal (int fd, char *buf, size_t > buflen, struct stat64 *stp) return ERANGE; > } > =20 > - if (__fxstat64 (_STAT_VER, fd, stp) < 0) > + if (__fstat64 (fd, stp) < 0) > return errno; > =20 > /* 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] =3D '\0'; > } > =20 > - if (__xstat64 (_STAT_VER, buf, stp) < 0) > + if (__stat64 (buf, stp) < 0) > return errno; > =20 > /* Check if the name we're about to return really corresponds to a > diff --git a/sysdeps/unix/sysv/linux/ttyname.c > b/sysdeps/unix/sysv/linux/ttyname.c index c05ca687f5..5fa6645353 > 100644 --- a/sysdeps/unix/sysv/linux/ttyname.c > +++ b/sysdeps/unix/sysv/linux/ttyname.c > @@ -84,7 +84,7 @@ getttyname (const char *dev, const struct stat64 > *mytty, int save, int *dostat) *((char *) __mempcpy (getttyname_name, > dev, devlen - 1)) =3D '/'; } > memcpy (&getttyname_name[devlen], d->d_name, dlen); > - if (__xstat64 (_STAT_VER, getttyname_name, &st) =3D=3D 0 > + if (__stat64 (getttyname_name, &st) =3D=3D 0 > && is_mytty (mytty, &st)) > { > (void) __closedir (dirstream); > @@ -125,7 +125,7 @@ ttyname (int fd) > if (__glibc_unlikely (__tcgetattr (fd, &term) < 0)) > return NULL; > =20 > - if (__fxstat64 (_STAT_VER, fd, &st) < 0) > + if (__fstat64 (fd, &st) < 0) > return NULL; > =20 > /* We try using the /proc filesystem. */ > @@ -162,14 +162,14 @@ ttyname (int fd) > =20 > /* Verify readlink result, fall back on iterating through > devices. */ if (ttyname_buf[0] =3D=3D '/' > - && __xstat64 (_STAT_VER, ttyname_buf, &st1) =3D=3D 0 > + && __stat64 (ttyname_buf, &st1) =3D=3D 0 > && is_mytty (&st, &st1)) > return ttyname_buf; > =20 > doispty =3D 1; > } > =20 > - if (__xstat64 (_STAT_VER, "/dev/pts", &st1) =3D=3D 0 && S_ISDIR > (st1.st_mode)) > + if (__stat64 ("/dev/pts", &st1) =3D=3D 0 && S_ISDIR (st1.st_mode)) > { > name =3D getttyname ("/dev/pts", &st, save, &dostat); > } > diff --git a/sysdeps/unix/sysv/linux/ttyname_r.c > b/sysdeps/unix/sysv/linux/ttyname_r.c index 4a1ae40bb2..ad8cd28158 > 100644 --- a/sysdeps/unix/sysv/linux/ttyname_r.c > +++ b/sysdeps/unix/sysv/linux/ttyname_r.c > @@ -71,7 +71,7 @@ getttyname_r (char *buf, size_t buflen, const > struct stat64 *mytty, cp =3D __stpncpy (buf + devlen, d->d_name, > needed); cp[0] =3D '\0'; > =20 > - if (__xstat64 (_STAT_VER, buf, &st) =3D=3D 0 > + if (__stat64 (buf, &st) =3D=3D 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; > =20 > - if (__fxstat64 (_STAT_VER, fd, &st) < 0) > + if (__fstat64 (fd, &st) < 0) > return errno; > =20 > /* We try using the /proc filesystem. */ > @@ -146,7 +146,7 @@ __ttyname_r (int fd, char *buf, size_t buflen) > =20 > /* Verify readlink result, fall back on iterating through > devices. */ if (buf[0] =3D=3D '/' > - && __xstat64 (_STAT_VER, buf, &st1) =3D=3D 0 > + && __stat64 (buf, &st1) =3D=3D 0 > && is_mytty (&st, &st1)) > return 0; > =20 > @@ -157,7 +157,7 @@ __ttyname_r (int fd, char *buf, size_t buflen) > memcpy (buf, "/dev/pts/", sizeof ("/dev/pts/")); > buflen -=3D sizeof ("/dev/pts/") - 1; > =20 > - if (__xstat64 (_STAT_VER, buf, &st1) =3D=3D 0 && S_ISDIR (st1.st_mode)) > + if (__stat64 (buf, &st1) =3D=3D 0 && S_ISDIR (st1.st_mode)) > { > ret =3D getttyname_r (buf, buflen, &st, save, > &dostat); > diff --git a/sysvipc/ftok.c b/sysvipc/ftok.c > index 0b6dab403f..a65dbd520a 100644 > --- a/sysvipc/ftok.c > +++ b/sysvipc/ftok.c > @@ -25,7 +25,7 @@ ftok (const char *pathname, int proj_id) > struct stat64 st; > key_t key; > =20 > - if (__xstat64 (_STAT_VER, pathname, &st) < 0) > + if (__stat64 (pathname, &st) < 0) > return (key_t) -1; > =20 > key =3D ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) > diff --git a/time/getdate.c b/time/getdate.c > index d5c01b8446..ddd97ba277 100644 > --- a/time/getdate.c > +++ b/time/getdate.c > @@ -121,7 +121,7 @@ __getdate_r (const char *string, struct tm *tp) > if (datemsk =3D=3D NULL || *datemsk =3D=3D '\0') > return 1; > =20 > - if (stat64 (datemsk, &st) < 0) > + if (__stat64 (datemsk, &st) < 0) > return 3; > =20 > if (!S_ISREG (st.st_mode)) > diff --git a/time/tzfile.c b/time/tzfile.c > index af6da1bf00..e8084a86e8 100644 > --- a/time/tzfile.c > +++ b/time/tzfile.c > @@ -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) =3D=3D 0 > + && __stat64 (file, &st) =3D=3D 0 > && tzfile_ino =3D=3D st.st_ino && tzfile_dev =3D=3D st.st_dev > && tzfile_mtime =3D=3D 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; > =20 > /* Get information about the file we are actually using. */ > - if (fstat64 (__fileno (f), &st) !=3D 0) > + if (__fstat64 (__fileno (f), &st) !=3D 0) > goto lose; > =20 > free ((void *) transitions); Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de --Sig_/X7IW_0.G6aHH4WozYjB0NYR Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAl8apuYACgkQAR8vZIA0 zr02Agf+LhGlt0cmfYtjVI2qRZf4Zbhy0EznTV0auBDUDqatcnGQWJQy+LSsxZta mFo6lKuqCGhAnNDgezAkRdaJ9Kirogf7E8XXhZ6rTFqelDe9Nx0qwIuj+3kn0aPw NJL6+ZValeBv9B+RSWd3bB2WSFg4zJ/kQ5XhaPydOnKsOBE/KfGjUraDbk3skVGy ZYflwX6UTq2Uxeag9JShhsKU+N8NM8J+f4iKE9mFjUeORPeLd8WgzPzs0kVXyd6V eAkODZX9cpzBaxU7cCgvMXQ9Z84Qnk3bxmWx+R8jzBG43OifaQqKWiUUAITBgt2O eiSXvG44c0bFJknVW6SyFc15Y7xUOw== =Skmk -----END PGP SIGNATURE----- --Sig_/X7IW_0.G6aHH4WozYjB0NYR--