From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by sourceware.org (Postfix) with ESMTPS id E3E603836024 for ; Mon, 21 Jun 2021 07:42:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E3E603836024 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=denx.de Received: from ktm (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id F149A828BC; Mon, 21 Jun 2021 09:42:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1624261350; bh=OPsCeE6CeIreqsMU80JMiwfnmeS7zy5jaibOVa5aN70=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=W11rh/Y2OEx0+poJphgTnCq1t9p0f6BFJXbbxMyFe/no+nvaLP7aTAWDEcT9lZnEL 2z3hLwENemBJ+op6gIPC3GjRehKQTX86qVTLXY8kJhiCM0GSXzsp5PL0F2yd5dZr9T J21OlqDkUih4yXZXGfPpYozZlyYZCMddBVXLTiHpcUyyHiotwhJPN2nGgWPgqS+S5F 1W8kP6rSXlxGiyxw1mpTdE19gvPn9617jAaaLhQMeAwxMpQ995KQMopEQ4sQRe0bEg UK2zQSvSjw229PQcNFwBPKZglNCRhsWxFoX0+sEnNMbG/f53i8LQIV6AWcHM+PwyYK lzycF8mNgL0Vg== Date: Mon, 21 Jun 2021 09:42:21 +0200 From: Lukasz Majewski To: Adhemerval Zanella Cc: libc-alpha@sourceware.org, Carlos O'Donell Subject: Re: [PATCH 01/18] Use 64 bit time_t stat internally Message-ID: <20210621094221.7e6fa2f5@ktm> In-Reply-To: <20210617115104.1359598-2-adhemerval.zanella@linaro.org> References: <20210617115104.1359598-1-adhemerval.zanella@linaro.org> <20210617115104.1359598-2-adhemerval.zanella@linaro.org> Organization: denx.de X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/Quf4sxkpEyKly5aHCVHgpSw"; protocol="application/pgp-signature" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Mon, 21 Jun 2021 07:42:36 -0000 --Sig_/Quf4sxkpEyKly5aHCVHgpSw Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 17 Jun 2021 08:50:47 -0300 Adhemerval Zanella wrote: > For the legacy ABI with supports 32 bit time_t it calls the 64 bit > time directly, since the LFS symbols calls the 64 bit time_t ones > internally. >=20 > Checked on i686-linux-gnu and x86_64-linux-gnu. > --- > csu/check_fds.c | 8 ++++---- > elf/dl-load.c | 8 ++++---- > elf/dl-misc.c | 4 ++-- > elf/dl-profile.c | 4 ++-- > iconv/gconv_cache.c | 4 ++-- > include/dirent.h | 2 +- > include/file_change_detection.h | 6 +++--- > inet/rcmd.c | 6 +++--- > intl/loadmsgcat.c | 4 ++-- > io/Makefile | 4 ++-- > io/file_change_detection.c | 16 +++++++++------- > io/getdirname.c | 6 +++--- > libio/filedoalloc.c | 2 +- > libio/fileops.c | 8 ++++---- > libio/oldfileops.c | 2 +- > libio/wfileops.c | 2 +- > locale/loadarchive.c | 8 ++++---- > locale/loadlocale.c | 6 +++--- > nscd/nscd_helper.c | 4 ++-- > nss/nss_database.c | 4 ++-- > sysdeps/posix/dl-fileid.h | 4 ++-- > sysdeps/posix/euidaccess.c | 4 ++-- > sysdeps/posix/getaddrinfo.c | 21 +++++++++++---------- > sysdeps/posix/getcwd.c | 15 ++++++++------- > sysdeps/posix/pathconf.c | 4 ++-- > sysdeps/posix/sysconf.c | 4 ++-- > sysdeps/posix/tempname.c | 8 ++++---- > sysdeps/unix/sysv/linux/fdopendir.c | 4 ++-- > sysdeps/unix/sysv/linux/fexecve.c | 4 ++-- > sysdeps/unix/sysv/linux/opendir.c | 7 ++++--- > sysdeps/unix/sysv/linux/pathconf.c | 5 +++-- > sysdeps/unix/sysv/linux/ttyname.h | 10 ++-------- > sysdeps/unix/sysv/linux/ttyname_r.c | 16 ++++++++-------- > sysvipc/ftok.c | 4 ++-- > time/tzfile.c | 6 +++--- > 35 files changed, 112 insertions(+), 112 deletions(-) >=20 > diff --git a/csu/check_fds.c b/csu/check_fds.c > index fbab28c284..6dc67334af 100644 > --- a/csu/check_fds.c > +++ b/csu/check_fds.c > @@ -69,10 +69,10 @@ check_one_fd (int fd, int mode) > Note that the following code assumes that STDIN_FILENO, > STDOUT_FILENO, STDERR_FILENO are the three lowest file > decsriptor numbers, in this order. */ > - struct stat64 st; > - if (__builtin_expect (nullfd !=3D fd, 0) > - || __builtin_expect (__fstat64 (fd, &st), 0) !=3D 0 > - || __builtin_expect (S_ISCHR (st.st_mode), 1) =3D=3D 0 > + struct __stat64_t64 st; > + if (__glibc_unlikely (nullfd !=3D fd) > + || __glibc_likely (__fstat64_time64 (fd, &st) !=3D 0) > + || __glibc_unlikely (S_ISCHR (st.st_mode) =3D=3D 0) > || st.st_rdev !=3D dev) > /* We cannot even give an error message here since it would > run into the same problems. */ > diff --git a/elf/dl-load.c b/elf/dl-load.c > index 918ec7546c..a08df001af 100644 > --- a/elf/dl-load.c > +++ b/elf/dl-load.c > @@ -1946,11 +1946,11 @@ open_path (const char *name, size_t namelen, > int mode, { > /* We failed to open machine dependent library. > Let's test whether there is any directory at all. */ > - struct stat64 st; > + struct __stat64_t64 st; > =20 > buf[buflen - namelen - 1] =3D '\0'; > =20 > - if (__stat64 (buf, &st) !=3D 0 > + if (__stat64_time64 (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; > @@ -1968,9 +1968,9 @@ open_path (const char *name, size_t namelen, > int mode, /* This is an extra security effort to make sure nobody can > preload broken shared objects which are in the > trusted directories and so exploit the bugs. */ > - struct stat64 st; > + struct __stat64_t64 st; > =20 > - if (__fstat64 (fd, &st) !=3D 0 > + if (__fstat64_time64 (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 d4803bba4e..b256d792c6 100644 > --- a/elf/dl-misc.c > +++ b/elf/dl-misc.c > @@ -43,11 +43,11 @@ void * > _dl_sysdep_read_whole_file (const char *file, size_t *sizep, int > prot) { > void *result =3D MAP_FAILED; > - struct stat64 st; > + struct __stat64_t64 st; > int fd =3D __open64_nocancel (file, O_RDONLY | O_CLOEXEC); > if (fd >=3D 0) > { > - if (__fstat64 (fd, &st) >=3D 0) > + if (__fstat64_time64 (fd, &st) >=3D 0) > { > *sizep =3D st.st_size; > =20 > diff --git a/elf/dl-profile.c b/elf/dl-profile.c > index 35b03959bc..088c023d95 100644 > --- a/elf/dl-profile.c > +++ b/elf/dl-profile.c > @@ -185,7 +185,7 @@ _dl_start_profile (void) > { > char *filename; > int fd; > - struct stat64 st; > + struct __stat64_t64 st; > const ElfW(Phdr) *ph; > ElfW(Addr) mapstart =3D ~((ElfW(Addr)) 0); > ElfW(Addr) mapend =3D 0; > @@ -342,7 +342,7 @@ _dl_start_profile (void) > return; > } > =20 > - if (__fstat64 (fd, &st) < 0 || !S_ISREG (st.st_mode)) > + if (__fstat64_time64 (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 642cc731eb..68d6386d01 100644 > --- a/iconv/gconv_cache.c > +++ b/iconv/gconv_cache.c > @@ -48,7 +48,7 @@ int > __gconv_load_cache (void) > { > int fd; > - struct stat64 st; > + struct __stat64_t64 st; > struct gconvcache_header *header; > =20 > /* We cannot use the cache if the GCONV_PATH environment variable > is @@ -64,7 +64,7 @@ __gconv_load_cache (void) > return -1; > =20 > /* Get information about the file. */ > - if (__builtin_expect (__fstat64 (fd, &st), 0) < 0 > + if (__glibc_unlikely (__fstat64_time64 (fd, &st) < 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/dirent.h b/include/dirent.h > index f1d7e8359c..d7567f5e86 100644 > --- a/include/dirent.h > +++ b/include/dirent.h > @@ -49,7 +49,7 @@ extern int __versionsort64 (const struct dirent64 > **a, const struct dirent64 **b) > __attribute_pure__; > extern DIR *__alloc_dir (int fd, bool close_fd, int flags, > - const struct stat64 *statp) > + const struct __stat64_t64 *statp) > __nonnull (4) attribute_hidden; > extern __typeof (rewinddir) __rewinddir; > extern __typeof (seekdir) __seekdir; > diff --git a/include/file_change_detection.h > b/include/file_change_detection.h index 9de2bd0b79..953de7c7fd 100644 > --- a/include/file_change_detection.h > +++ b/include/file_change_detection.h > @@ -33,8 +33,8 @@ struct file_change_detection > off64_t size; > =20 > ino64_t ino; > - struct timespec mtime; > - struct timespec ctime; > + struct __timespec64 mtime; > + struct __timespec64 ctime; > }; > =20 > /* Returns true if *LEFT and *RIGHT describe the same version of the > @@ -45,7 +45,7 @@ bool __file_is_unchanged (const struct > file_change_detection *left, /* Extract file change information to > *FILE from the stat buffer *ST. */ > void __file_change_detection_for_stat (struct file_change_detection > *file, > - const struct stat64 *st); > + const struct __stat64_t64 > *st);=20 > /* Writes file change information for PATH to *FILE. Returns true on > success. For benign errors, *FILE is cleared, and true is > diff --git a/inet/rcmd.c b/inet/rcmd.c > index 0cfdaee15e..0d6b595572 100644 > --- a/inet/rcmd.c > +++ b/inet/rcmd.c > @@ -468,14 +468,14 @@ ruserok (const char *rhost, int superuser, > const char *ruser, static FILE * > iruserfopen (const char *file, uid_t okuser) > { > - struct stat64 st; > + struct __stat64_t64 st; > char *cp =3D NULL; > FILE *res =3D NULL; > =20 > /* 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 (__lstat64 (file, &st)) > + if (__lstat64_time64 (file, &st)) > cp =3D _("lstat failed"); > else if (!S_ISREG (st.st_mode)) > cp =3D _("not regular file"); > @@ -484,7 +484,7 @@ iruserfopen (const char *file, uid_t okuser) > res =3D fopen (file, "rce"); > if (!res) > cp =3D _("cannot open"); > - else if (__fstat64 (fileno (res), &st) < 0) > + else if (__fstat64_time64 (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/intl/loadmsgcat.c b/intl/loadmsgcat.c > index 4fda9b0219..30588e9996 100644 > --- a/intl/loadmsgcat.c > +++ b/intl/loadmsgcat.c > @@ -756,7 +756,7 @@ _nl_load_domain (struct loaded_l10nfile > *domain_file, int fd =3D -1; > size_t size; > #ifdef _LIBC > - struct stat64 st; > + struct __stat64_t64 st; > #else > struct stat st; > #endif > @@ -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_time64 (fd, &st) !=3D 0, 0) > #else > __builtin_expect (fstat (fd, &st) !=3D 0, 0) > #endif > diff --git a/io/Makefile b/io/Makefile > index ba8bd37355..1a16990205 100644 > --- a/io/Makefile > +++ b/io/Makefile > @@ -69,7 +69,7 @@ tests :=3D test-utime test-stat > test-stat2 test-lfs tst-getcwd \ tst-posix_fallocate > tst-posix_fallocate64 \ tst-fts tst-fts-lfs tst-open-tmpfile \ > tst-copy_file_range tst-getcwd-abspath tst-lockf \ > - tst-ftw-lnk tst-file_change_detection tst-lchmod \ > + tst-ftw-lnk tst-lchmod \ > tst-ftw-bz26353 tst-stat tst-stat-lfs \ > tst-utime \ > tst-utimes \ > @@ -90,7 +90,7 @@ tests-time64 :=3D \ > tst-utimes-time64 \ > =20 > # Likewise for statx, but we do not need static linking here. > -tests-internal +=3D tst-statx > +tests-internal +=3D tst-statx tst-file_change_detection > tests-static +=3D tst-statx > =20 > ifeq ($(run-built-tests),yes) > diff --git a/io/file_change_detection.c b/io/file_change_detection.c > index 9871bc9166..ac5e451513 100644 > --- a/io/file_change_detection.c > +++ b/io/file_change_detection.c > @@ -44,7 +44,7 @@ libc_hidden_def (__file_is_unchanged) > =20 > void > __file_change_detection_for_stat (struct file_change_detection *file, > - const struct stat64 *st) > + const struct __stat64_t64 *st) > { > if (S_ISDIR (st->st_mode)) > /* Treat as empty file. */ > @@ -56,8 +56,10 @@ __file_change_detection_for_stat (struct > file_change_detection *file, { > file->size =3D st->st_size; > file->ino =3D st->st_ino; > - file->mtime =3D st->st_mtim; > - file->ctime =3D st->st_ctim; > + file->mtime =3D (struct __timespec64 ) { .tv_sec =3D > st->st_mtim.tv_sec, > + .tv_nsec =3D > st->st_mtim.tv_nsec }; > + file->ctime =3D (struct __timespec64 ) { .tv_sec =3D > st->st_ctim.tv_sec, > + .tv_nsec =3D > st->st_mtim.tv_nsec }; } > } > libc_hidden_def (__file_change_detection_for_stat) > @@ -66,8 +68,8 @@ bool > __file_change_detection_for_path (struct file_change_detection *file, > const char *path) > { > - struct stat64 st; > - if (__stat64 (path, &st) !=3D 0) > + struct __stat64_t64 st; > + if (__stat64_time64 (path, &st) !=3D 0) > switch (errno) > { > case EACCES: > @@ -104,8 +106,8 @@ __file_change_detection_for_fp (struct > file_change_detection *file, } > else > { > - struct stat64 st; > - if (__fstat64 (__fileno (fp), &st) !=3D 0) > + struct __stat64_t64 st; > + if (__fstat64_time64 (__fileno (fp), &st) !=3D 0) > /* If we already have a file descriptor, all errors are > fatal. */ return false; > else > diff --git a/io/getdirname.c b/io/getdirname.c > index 32b5ab4b6c..f29e910b37 100644 > --- a/io/getdirname.c > +++ b/io/getdirname.c > @@ -28,12 +28,12 @@ char * > get_current_dir_name (void) > { > char *pwd; > - struct stat64 dotstat, pwdstat; > + struct __stat64_t64 dotstat, pwdstat; > =20 > pwd =3D getenv ("PWD"); > if (pwd !=3D NULL > - && __stat64 (".", &dotstat) =3D=3D 0 > - && __stat64 (pwd, &pwdstat) =3D=3D 0 > + && __stat64_time64 (".", &dotstat) =3D=3D 0 > + && __stat64_time64 (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/libio/filedoalloc.c b/libio/filedoalloc.c > index 7afa3cb683..c792eec88f 100644 > --- a/libio/filedoalloc.c > +++ b/libio/filedoalloc.c > @@ -78,7 +78,7 @@ _IO_file_doallocate (FILE *fp) > { > size_t size; > char *p; > - struct stat64 st; > + struct __stat64_t64 st; > =20 > size =3D BUFSIZ; > if (fp->_fileno >=3D 0 && __builtin_expect (_IO_SYSSTAT (fp, &st), > 0) >=3D 0) diff --git a/libio/fileops.c b/libio/fileops.c > index a71a567547..e8ee374821 100644 > --- a/libio/fileops.c > +++ b/libio/fileops.c > @@ -545,7 +545,7 @@ libc_hidden_ver (_IO_new_file_underflow, > _IO_file_underflow) static int > mmap_remap_check (FILE *fp) > { > - struct stat64 st; > + struct __stat64_t64 st; > =20 > if (_IO_SYSSTAT (fp, &st) =3D=3D 0 > && S_ISREG (st.st_mode) && st.st_size !=3D 0 > @@ -663,7 +663,7 @@ decide_maybe_mmap (FILE *fp) > file descriptors are for mmap-able objects and on 32-bit > machines we don't want to map files which are too large since > this would require too much virtual memory. */ > - struct stat64 st; > + struct __stat64_t64 st; > =20 > if (_IO_SYSSTAT (fp, &st) =3D=3D 0 > && S_ISREG (st.st_mode) && st.st_size !=3D 0 > @@ -962,7 +962,7 @@ _IO_new_file_seekoff (FILE *fp, off64_t offset, > int dir, int mode) break; > case _IO_seek_end: > { > - struct stat64 st; > + struct __stat64_t64 st; > if (_IO_SYSSTAT (fp, &st) =3D=3D 0 && S_ISREG (st.st_mode)) > { > offset +=3D st.st_size; > @@ -1145,7 +1145,7 @@ libc_hidden_def (_IO_file_seek) > int > _IO_file_stat (FILE *fp, void *st) > { > - return __fstat64 (fp->_fileno, (struct stat64 *) st); > + return __fstat64_time64 (fp->_fileno, (struct __stat64_t64 *) st); > } > libc_hidden_def (_IO_file_stat) > =20 > diff --git a/libio/oldfileops.c b/libio/oldfileops.c > index ed235360ad..ed3c98bd6d 100644 > --- a/libio/oldfileops.c > +++ b/libio/oldfileops.c > @@ -487,7 +487,7 @@ _IO_old_file_seekoff (FILE *fp, off64_t offset, > int dir, int mode) break; > case _IO_seek_end: > { > - struct stat64 st; > + struct __stat64_t64 st; > if (_IO_SYSSTAT (fp, &st) =3D=3D 0 && S_ISREG (st.st_mode)) > { > offset +=3D st.st_size; > diff --git a/libio/wfileops.c b/libio/wfileops.c > index 5d23566171..37f44780f8 100644 > --- a/libio/wfileops.c > +++ b/libio/wfileops.c > @@ -840,7 +840,7 @@ _IO_wfile_seekoff (FILE *fp, off64_t offset, int > dir, int mode) break; > case _IO_seek_end: > { > - struct stat64 st; > + struct __stat64_t64 st; > if (_IO_SYSSTAT (fp, &st) =3D=3D 0 && S_ISREG (st.st_mode)) > { > offset +=3D st.st_size; > diff --git a/locale/loadarchive.c b/locale/loadarchive.c > index 4177fc8972..512769eaec 100644 > --- a/locale/loadarchive.c > +++ b/locale/loadarchive.c > @@ -78,7 +78,7 @@ static struct archmapped *archmapped; > ARCHMAPPED points to this; if mapping the archive header failed, > then headmap.ptr is null. */ > static struct archmapped headmap; > -static struct stat64 archive_stat; /* stat of archive when header > mapped. */ +static struct __stat64_t64 archive_stat; /* stat of > archive when header mapped. */=20 > /* Record of locales that we have already loaded from the archive. > */ struct locale_in_archive > @@ -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 (__fstat64 (fd, &archive_stat) =3D=3D -1) > + if (__fstat64_time64 (fd, &archive_stat) =3D=3D -1) > { > /* stat failed, very strange. */ > close_and_out: > @@ -396,7 +396,7 @@ _nl_load_locale_from_archive (int category, const > char **namep) /* Open the file if it hasn't happened yet. */ > if (fd =3D=3D -1) > { > - struct stat64 st; > + struct __stat64_t64 st; > fd =3D __open_nocancel (archfname, > O_RDONLY|O_LARGEFILE|O_CLOEXEC); > if (fd =3D=3D -1) > @@ -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 (__fstat64 (fd, &st) < 0 > + if (__fstat64_time64 (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 9c03490883..f4e6cc9fc2 100644 > --- a/locale/loadlocale.c > +++ b/locale/loadlocale.c > @@ -167,7 +167,7 @@ _nl_load_locale (struct loaded_l10nfile *file, > int category) { > int fd; > void *filedata; > - struct stat64 st; > + struct __stat64_t64 st; > struct __locale_data *newdata; > int save_err; > int alloc =3D ld_mapped; > @@ -180,7 +180,7 @@ _nl_load_locale (struct loaded_l10nfile *file, > int category) /* Cannot open the file. */ > return; > =20 > - if (__builtin_expect (__fstat64 (fd, &st), 0) < 0) > + if (__glibc_unlikely (__fstat64_time64 (fd, &st) < 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 (__fstat64 (fd, &st), 0) < 0) > + if (__glibc_unlikely (__fstat64_time64 (fd, &st) < 0)) > goto puntfd; > } > =20 > diff --git a/nscd/nscd_helper.c b/nscd/nscd_helper.c > index 462504d828..06ba7476e5 100644 > --- a/nscd/nscd_helper.c > +++ b/nscd/nscd_helper.c > @@ -324,8 +324,8 @@ __nscd_get_mapping (request_type type, const char > *key,=20 > if (__glibc_unlikely (n =3D=3D keylen)) > { > - struct stat64 st; > - if (__builtin_expect (__fstat64 (mapfd, &st) !=3D 0, 0) > + struct __stat64_t64 st; > + if (__glibc_unlikely (__fstat64_time64 (mapfd, &st) !=3D 0) > || __builtin_expect (st.st_size < sizeof (struct > database_pers_head), 0)) > goto out_close; > diff --git a/nss/nss_database.c b/nss/nss_database.c > index 1e11294406..ab121cb371 100644 > --- a/nss/nss_database.c > +++ b/nss/nss_database.c > @@ -394,7 +394,7 @@ nss_database_check_reload_and_get (struct > nss_database_state *local, nss_action_list *result, > enum nss_database database_index) > { > - struct stat64 str; > + struct __stat64_t64 str; > =20 > /* Acquire MO is needed because the thread that sets > reload_disabled may have loaded the configuration first, so > synchronize with the @@ -424,7 +424,7 @@ > nss_database_check_reload_and_get (struct nss_database_state *local, > errors here are very unlikely, but the chance that we're entering a > container is also very unlikely, so we err on the side of both very > unlikely things not happening at the same time. */ > - if (__stat64 ("/", &str) !=3D 0 > + if (__stat64_time64 ("/", &str) !=3D 0 > || (local->root_ino !=3D 0 > && (str.st_ino !=3D local->root_ino > || str.st_dev !=3D local->root_dev))) > diff --git a/sysdeps/posix/dl-fileid.h b/sysdeps/posix/dl-fileid.h > index 0bb6794dbe..bf437f3d71 100644 > --- a/sysdeps/posix/dl-fileid.h > +++ b/sysdeps/posix/dl-fileid.h > @@ -32,9 +32,9 @@ struct r_file_id > static inline bool > _dl_get_file_id (int fd, struct r_file_id *id) > { > - struct stat64 st; > + struct __stat64_t64 st; > =20 > - if (__glibc_unlikely (__fstat64 (fd, &st) < 0)) > + if (__glibc_unlikely (__fstat64_time64 (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 26ebb432a2..86f3285471 100644 > --- a/sysdeps/posix/euidaccess.c > +++ b/sysdeps/posix/euidaccess.c > @@ -119,7 +119,7 @@ int group_member (); > int > euidaccess (const char *path, int mode) > { > - struct stat64 stats; > + struct __stat64_t64 stats; > int granted; > =20 > #ifdef _LIBC > @@ -140,7 +140,7 @@ euidaccess (const char *path, int mode) > return access (path, mode); > #endif > =20 > - if (__stat64 (path, &stats)) > + if (__stat64_time64 (path, &stats)) > return -1; > =20 > mode &=3D (X_OK | W_OK | R_OK); /* Clear any bogus bits. */ > diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c > index b7e1aee80f..b2831508c4 100644 > --- a/sysdeps/posix/getaddrinfo.c > +++ b/sysdeps/posix/getaddrinfo.c > @@ -1636,16 +1636,17 @@ static int gaiconf_reload_flag_ever_set; > /* Last modification time. */ > #ifdef _STATBUF_ST_NSEC > =20 > -static struct timespec gaiconf_mtime; > +static struct __timespec64 gaiconf_mtime; > =20 > static inline void > -save_gaiconf_mtime (const struct stat64 *st) > +save_gaiconf_mtime (const struct __stat64_t64 *st) > { > - gaiconf_mtime =3D st->st_mtim; > + gaiconf_mtime =3D (struct __timespec64) { .tv_sec =3D > st->st_mtim.tv_sec, > + .tv_nsec =3D > st->st_mtim.tv_nsec }; } > =20 > static inline bool > -check_gaiconf_mtime (const struct stat64 *st) > +check_gaiconf_mtime (const struct __stat64_t64 *st) > { > return (st->st_mtim.tv_sec =3D=3D gaiconf_mtime.tv_sec > && st->st_mtim.tv_nsec =3D=3D gaiconf_mtime.tv_nsec); > @@ -1656,13 +1657,13 @@ check_gaiconf_mtime (const struct stat64 *st) > static time_t gaiconf_mtime; > =20 > static inline void > -save_gaiconf_mtime (const struct stat64 *st) > +save_gaiconf_mtime (const struct __stat64_t64 *st) > { > gaiconf_mtime =3D st->st_mtime; > } > =20 > static inline bool > -check_gaiconf_mtime (const struct stat64 *st) > +check_gaiconf_mtime (const struct __stat64_t64 *st) > { > return st->st_mtime =3D=3D gaiconf_mtime; > } > @@ -1777,8 +1778,8 @@ gaiconf_init (void) > FILE *fp =3D fopen (GAICONF_FNAME, "rce"); > if (fp !=3D NULL) > { > - struct stat64 st; > - if (__fstat64 (fileno (fp), &st) !=3D 0) > + struct __stat64_t64 st; > + if (__fstat64_time64 (fileno (fp), &st) !=3D 0) > { > fclose (fp); > goto no_file; > @@ -2130,8 +2131,8 @@ gaiconf_init (void) > static void > gaiconf_reload (void) > { > - struct stat64 st; > - if (__stat64 (GAICONF_FNAME, &st) !=3D 0 > + struct __stat64_t64 st; > + if (__stat64_time64 (GAICONF_FNAME, &st) !=3D 0 > || !check_gaiconf_mtime (&st)) > gaiconf_init (); > } > diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c > index f11644aae7..13680026ff 100644 > --- a/sysdeps/posix/getcwd.c > +++ b/sysdeps/posix/getcwd.c > @@ -183,7 +183,7 @@ __getcwd_generic (char *buf, size_t size) > ino_t rootino, thisino; > char *dir; > register char *dirp; > - struct stat64 st; > + struct __stat64_t64 st; > size_t allocated =3D size; > size_t used; > =20 > @@ -249,12 +249,12 @@ __getcwd_generic (char *buf, size_t size) > dirp =3D dir + allocated; > *--dirp =3D '\0'; > =20 > - if (__lstat64 (".", &st) < 0) > + if (__lstat64_time64 (".", &st) < 0) > goto lose; > thisdev =3D st.st_dev; > thisino =3D st.st_ino; > =20 > - if (__lstat64 ("/", &st) < 0) > + if (__lstat64_time64 ("/", &st) < 0) > goto lose; > rootdev =3D st.st_dev; > rootino =3D st.st_ino; > @@ -276,12 +276,12 @@ __getcwd_generic (char *buf, size_t size) > if (fd < 0) > goto lose; > fd_needs_closing =3D true; > - parent_status =3D __fstat64 (fd, &st); > + parent_status =3D __fstat64_time64 (fd, &st); > #else > dotlist[dotlen++] =3D '.'; > dotlist[dotlen++] =3D '.'; > dotlist[dotlen] =3D '\0'; > - parent_status =3D __lstat64 (dotlist, &st); > + parent_status =3D __lstat64_time64 (dotlist, &st); > #endif > if (parent_status !=3D 0) > goto lose; > @@ -353,7 +353,8 @@ __getcwd_generic (char *buf, size_t size) > { > int entry_status; > #if HAVE_OPENAT_SUPPORT > - entry_status =3D __fstatat64 (fd, d->d_name, &st, > AT_SYMLINK_NOFOLLOW); > + entry_status =3D __fstatat64_time64 (fd, d->d_name, &st, > + AT_SYMLINK_NOFOLLOW); > #else > /* Compute size needed for this file name, or for the > file name ".." in the same directory, whichever is larger. > @@ -390,7 +391,7 @@ __getcwd_generic (char *buf, size_t size) > } > =20 > memcpy (dotlist + dotlen, d->d_name, _D_ALLOC_NAMLEN > (d)); > - entry_status =3D __lstat64 (dotlist, &st); > + entry_status =3D __lstat64_time64 (dotlist, &st); > #endif > /* We don't fail here if we cannot stat() a directory > entry. This can happen when (network) file systems fail. If this > diff --git a/sysdeps/posix/pathconf.c b/sysdeps/posix/pathconf.c > index 9eb17d1536..89fcfad49d 100644 > --- a/sysdeps/posix/pathconf.c > +++ b/sysdeps/posix/pathconf.c > @@ -129,9 +129,9 @@ __pathconf (const char *path, int name) > #ifdef _POSIX_ASYNC_IO > { > /* AIO is only allowed on regular files and block devices. > */ > - struct stat64 st; > + struct __stat64_t64 st; > =20 > - if (__stat64 (path, &st) < 0 > + if (__stat64_time64 (path, &st) < 0 > || (! S_ISREG (st.st_mode) && ! S_ISBLK (st.st_mode))) > return -1; > else > diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c > index 54d6046d00..3e8ec5cd51 100644 > --- a/sysdeps/posix/sysconf.c > +++ b/sysdeps/posix/sysconf.c > @@ -1215,8 +1215,8 @@ __sysconf_check_spec (const char *spec) > "/POSIX_V6_", sizeof ("/POSIX_V6_") - 1), > spec, speclen + 1); > =20 > - struct stat64 st; > - long int ret =3D __stat64 (name, &st) >=3D 0 ? 1 : -1; > + struct __stat64_t64 st; > + long int ret =3D __stat64_time64 (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 5f804b38d7..ff38f1e31f 100644 > --- a/sysdeps/posix/tempname.c > +++ b/sysdeps/posix/tempname.c > @@ -55,14 +55,14 @@ > #include > =20 > #if _LIBC > -# define struct_stat64 struct stat64 > +# define struct_stat64 struct __stat64_t64 > # define __secure_getenv __libc_secure_getenv > #else > # define struct_stat64 struct stat > # define __gen_tempname gen_tempname > # define __mkdir mkdir > # define __open open > -# define __lstat64(file, buf) lstat (file, buf) > +# define __lstat64_time64(file, buf) lstat (file, buf) > # define __stat64(file, buf) stat (file, buf) > # define __getrandom getrandom > # define __clock_gettime64 clock_gettime > @@ -99,7 +99,7 @@ static int > direxists (const char *dir) > { > struct_stat64 buf; > - return __stat64 (dir, &buf) =3D=3D 0 && S_ISDIR (buf.st_mode); > + return __stat64_time64 (dir, &buf) =3D=3D 0 && S_ISDIR (buf.st_mode); > } > =20 > /* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is > @@ -191,7 +191,7 @@ try_nocreate (char *tmpl, void *flags _GL_UNUSED) > { > struct_stat64 st; > =20 > - if (__lstat64 (tmpl, &st) =3D=3D 0 || errno =3D=3D EOVERFLOW) > + if (__lstat64_time64 (tmpl, &st) =3D=3D 0 || errno =3D=3D EOVERFLOW) > __set_errno (EEXIST); > return errno =3D=3D ENOENT ? 0 : -1; > } > diff --git a/sysdeps/unix/sysv/linux/fdopendir.c > b/sysdeps/unix/sysv/linux/fdopendir.c index ede43f2485..32ec10e206 > 100644 --- a/sysdeps/unix/sysv/linux/fdopendir.c > +++ b/sysdeps/unix/sysv/linux/fdopendir.c > @@ -27,9 +27,9 @@ > DIR * > __fdopendir (int fd) > { > - struct stat64 statbuf; > + struct __stat64_t64 statbuf; > =20 > - if (__builtin_expect (__fstat64 (fd, &statbuf), 0) < 0) > + if (__glibc_unlikely (__fstat64_time64 (fd, &statbuf) < 0)) > return NULL; > if (__glibc_unlikely (! S_ISDIR (statbuf.st_mode))) > { > diff --git a/sysdeps/unix/sysv/linux/fexecve.c > b/sysdeps/unix/sysv/linux/fexecve.c index df25c2acb8..4dfcaeedc1 > 100644 --- a/sysdeps/unix/sysv/linux/fexecve.c > +++ b/sysdeps/unix/sysv/linux/fexecve.c > @@ -58,8 +58,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 stat64 st; > - if (__stat64 ("/proc/self/fd", &st) !=3D 0 && errno =3D=3D ENOENT) > + struct __stat64_t64 st; > + if (__stat64_time64 ("/proc/self/fd", &st) !=3D 0 && errno =3D=3D ENOE= NT) > save =3D ENOSYS; > =20 > __set_errno (save); > diff --git a/sysdeps/unix/sysv/linux/opendir.c > b/sysdeps/unix/sysv/linux/opendir.c index 4020a826f9..48f254d169 > 100644 --- a/sysdeps/unix/sysv/linux/opendir.c > +++ b/sysdeps/unix/sysv/linux/opendir.c > @@ -49,8 +49,8 @@ opendir_tail (int fd) > /* Now make sure this really is a directory and nothing changed > since the `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 (__fstat64 (fd, &statbuf) < 0)) > + struct __stat64_t64 statbuf; > + if (__glibc_unlikely (__fstat64_time64 (fd, &statbuf) < 0)) > goto lose; > if (__glibc_unlikely (! S_ISDIR (statbuf.st_mode))) > { > @@ -88,7 +88,8 @@ __opendir (const char *name) > weak_alias (__opendir, opendir) > =20 > DIR * > -__alloc_dir (int fd, bool close_fd, int flags, const struct stat64 > *statp) +__alloc_dir (int fd, bool close_fd, int flags, > + const struct __stat64_t64 *statp) > { > /* We have to set the close-on-exit flag if the user provided the > file descriptor. */ > diff --git a/sysdeps/unix/sysv/linux/pathconf.c > b/sysdeps/unix/sysv/linux/pathconf.c index f37e8aaf68..b599a66c93 > 100644 --- a/sysdeps/unix/sysv/linux/pathconf.c > +++ b/sysdeps/unix/sysv/linux/pathconf.c > @@ -65,9 +65,10 @@ distinguish_extX (const struct statfs *fsbuf, > const char *file, int fd) { > char buf[64]; > char path[PATH_MAX]; > - struct stat64 st; > + struct __stat64_t64 st; > =20 > - if ((file =3D=3D NULL ? __fstat64 (fd, &st) : __stat64 (file, &st)) != =3D > 0) > + if ((file =3D=3D NULL ? __fstat64_time64 (fd, &st) > + : __stat64_time64 (file, &st)) !=3D 0) > /* Strange. The statfd call worked, but stat fails. Default to > the more pessimistic value. */ > return EXT2_LINK_MAX; > diff --git a/sysdeps/unix/sysv/linux/ttyname.h > b/sysdeps/unix/sysv/linux/ttyname.h index 0a0048cc02..5dcbfef973 > 100644 --- a/sysdeps/unix/sysv/linux/ttyname.h > +++ b/sysdeps/unix/sysv/linux/ttyname.h > @@ -25,24 +25,18 @@ > linux/Documentation/devices.txt (on linux < 4.10) or > linux/Documentation/admin-guide/devices.txt (on linux >=3D 4.10). > */ static inline bool > -is_pty (struct stat64 *sb) > +is_pty (struct __stat64_t64 *sb) > { > -#ifdef _STATBUF_ST_RDEV > int m =3D __gnu_dev_major (sb->st_rdev); > return (136 <=3D m && m <=3D 143); > -#else > - return false; > -#endif > } > =20 > static inline bool > -is_mytty (const struct stat64 *mytty, const struct stat64 *maybe) > +is_mytty (const struct __stat64_t64 *mytty, const struct > __stat64_t64 *maybe) { > return (maybe->st_ino =3D=3D mytty->st_ino > && maybe->st_dev =3D=3D mytty->st_dev > -#ifdef _STATBUF_ST_RDEV > && S_ISCHR (maybe->st_mode) > && maybe->st_rdev =3D=3D mytty->st_rdev > -#endif > ); > } > diff --git a/sysdeps/unix/sysv/linux/ttyname_r.c > b/sysdeps/unix/sysv/linux/ttyname_r.c index 899a851a83..9ef9f42883 > 100644 --- a/sysdeps/unix/sysv/linux/ttyname_r.c > +++ b/sysdeps/unix/sysv/linux/ttyname_r.c > @@ -31,15 +31,15 @@ > #include "ttyname.h" > =20 > static int getttyname_r (char *buf, size_t buflen, > - const struct stat64 *mytty, int save, > + const struct __stat64_t64 *mytty, int save, > int *dostat); > =20 > static int > attribute_compat_text_section > -getttyname_r (char *buf, size_t buflen, const struct stat64 *mytty, > +getttyname_r (char *buf, size_t buflen, const struct __stat64_t64 > *mytty, int save, int *dostat) > { > - struct stat64 st; > + struct __stat64_t64 st; > DIR *dirstream; > struct dirent64 *d; > size_t devlen =3D strlen (buf); > @@ -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 (__stat64 (buf, &st) =3D=3D 0 > + if (__stat64_time64 (buf, &st) =3D=3D 0 > && is_mytty (mytty, &st)) > { > (void) __closedir (dirstream); > @@ -93,7 +93,7 @@ int > __ttyname_r (int fd, char *buf, size_t buflen) > { > struct fd_to_filename filename; > - struct stat64 st, st1; > + struct __stat64_t64 st, st1; > int dostat =3D 0; > int doispty =3D 0; > int save =3D errno; > @@ -118,7 +118,7 @@ __ttyname_r (int fd, char *buf, size_t buflen) > if (__glibc_unlikely (__tcgetattr (fd, &term) < 0)) > return errno; > =20 > - if (__fstat64 (fd, &st) < 0) > + if (__fstat64_time64 (fd, &st) < 0) > return errno; > =20 > /* We try using the /proc filesystem. */ > @@ -144,7 +144,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 '/' > - && __stat64 (buf, &st1) =3D=3D 0 > + && __stat64_time64 (buf, &st1) =3D=3D 0 > && is_mytty (&st, &st1)) > return 0; > =20 > @@ -155,7 +155,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 (__stat64 (buf, &st1) =3D=3D 0 && S_ISDIR (st1.st_mode)) > + if (__stat64_time64 (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 2e39c74415..bd633bd395 100644 > --- a/sysvipc/ftok.c > +++ b/sysvipc/ftok.c > @@ -22,10 +22,10 @@ > key_t > ftok (const char *pathname, int proj_id) > { > - struct stat64 st; > + struct __stat64_t64 st; > key_t key; > =20 > - if (__stat64 (pathname, &st) < 0) > + if (__stat64_time64 (pathname, &st) < 0) > return (key_t) -1; > =20 > key =3D ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) > diff --git a/time/tzfile.c b/time/tzfile.c > index 040a5e341f..4377018a55 100644 > --- a/time/tzfile.c > +++ b/time/tzfile.c > @@ -150,9 +150,9 @@ __tzfile_read (const char *file, size_t extra, > char **extrap) } > =20 > /* If we were already using tzfile, check whether the file > changed. */ > - struct stat64 st; > + struct __stat64_t64 st; > if (was_using_tzfile > - && __stat64 (file, &st) =3D=3D 0 > + && __stat64_time64 (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_time64 (__fileno (f), &st) !=3D 0) > goto lose; > =20 > free ((void *) transitions); Reviewed-by: Lukasz Majewski 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_/Quf4sxkpEyKly5aHCVHgpSw Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAmDQQt0ACgkQAR8vZIA0 zr3nggf/cXCEtrmXeum/EDTkFCnJX2JX5h1PTx+tYivUPq8aAOSgCJS9n7jtGfgb sT/kJTqQAhLf/4pIEbRa5cJGsKAo74uq8T8WC+i1KDJ8B259sTdb+3pcMx6k0mUg +Hd6QdsTVQ46BYMUQfqjaN5ECv5jgsWtpo+VqfpU0SbqwKBcYuWVSqfN4W8Bh/iR MFCrzDJHgbKnM9jK2GsnS2WlQCukZOv6WKz4T5YWKkouBSbaO/fJZO6OA33IK5/v Xcs9hKDSQTn93GZ0kzhvpQKsc/TZwpeAevpA/OK7FfOwerX+8OZu4xkbl3G9CS9T hrZ+vsdWSdK9NlGEpsXxspRftI4xOA== =8ACF -----END PGP SIGNATURE----- --Sig_/Quf4sxkpEyKly5aHCVHgpSw--