From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by sourceware.org (Postfix) with ESMTPS id 22C9B385782A for ; Wed, 17 Mar 2021 22:33:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 22C9B385782A 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 4F14g70DGLz1qrf4; Wed, 17 Mar 2021 23:33:07 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4F14g66mdtz1r1MW; Wed, 17 Mar 2021 23:33:06 +0100 (CET) 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 rmKlZ-S0j8-Z; Wed, 17 Mar 2021 23:33:04 +0100 (CET) X-Auth-Info: ekJMamOnwSj9MOQN1CkpeGPlIDZGX53a6hJGez0+rB0= 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; Wed, 17 Mar 2021 23:33:04 +0100 (CET) Date: Wed, 17 Mar 2021 23:32:55 +0100 From: Lukasz Majewski To: Adhemerval Zanella Cc: Florian Weimer , Joseph Myers , GNU C Library Subject: Re: [PATCH] support: Use __utimensat64 to set file access and modification times Message-ID: <20210317233255.35c55e91@jawa> In-Reply-To: <28429401-923a-6195-22e9-baf7a9f3abfb@linaro.org> References: <20210317153810.12070-1-lukma@denx.de> <87a6r11wqw.fsf@oldenburg.str.redhat.com> <28429401-923a-6195-22e9-baf7a9f3abfb@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_/_y/8_E5Si08SBzrDgTGu9v="; protocol="application/pgp-signature" X-Spam-Status: No, score=-14.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: Wed, 17 Mar 2021 22:33:10 -0000 --Sig_/_y/8_E5Si08SBzrDgTGu9v= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Adhemerval, > On 17/03/2021 15:05, Florian Weimer wrote: > > * Lukasz Majewski: > > =20 > >> @@ -49,8 +38,9 @@ support_path_support_time64 (const char *path) > >> { 0x80000001ULL, 0 }, > >> { 0x80000002ULL, 0 } > >> }; > >> - /* Return is kernel does not support __NR_utimensat_time64. */ > >> - if (utimesat_call (path, tsp) =3D=3D -1) > >> + > >> + /* Return if kernel does not support __NR_utimensat_time64. */ > >> + if (__utimensat64 (AT_FDCWD, path, &tsp[0], 0) =3D=3D -1) > >> return false; > >> =20 > >> /* Verify if the last access and last modification time match > >> the ones @@ -67,7 +57,7 @@ support_path_support_time64 (const char > >> *path) { ostx.stx_atime.tv_sec, ostx.stx_atime.tv_nsec }, > >> { ostx.stx_mtime.tv_sec, ostx.stx_mtime.tv_nsec }, > >> }; > >> - TEST_VERIFY_EXIT (utimesat_call (path, otsp) =3D=3D 0); > >> + TEST_VERIFY_EXIT (__utimensat64 (AT_FDCWD, path, &otsp[0], 0) > >> =3D=3D 0);=20 > >> return support; > >> #else =20 > >=20 > > I don't see how this can work given that __utimensat64 is currently > > a symbol exported from libc.so.6. Doesn't this result in link > > failures on, say, i386? =20 >=20 > It does not, it either fail with an invalid linking for legacy ABIs: >=20 > /libsupport_nonshared.a(support_path_support_time64.oS): in function > `support_path_support_time64': > /home/azanella/glibc/glibc-git/support/support_path_support_time64.c:43: > undefined reference to `__utimensat64' > /home/azanella/toolchain/install/compilers/arm-linux-gnueabihf/lib/gcc/ar= m-glibc-linux-gnueabihf/10.2.1/../../../../arm-glibc-linux-gnueabihf/bin/ld: > /home/azanella/glibc/glibc-git/support/support_path_su > pport_time64.c:60: undefined reference to `__utimensat64' >=20 > Or with the following for abi with default 64 bit support: >=20 > In file included from ../sysdeps/generic/hp-timing.h:23, > from ../nptl/descr.h:27, > from ../sysdeps/aarch64/nptl/tls.h:44, > from ../sysdeps/unix/sysv/linux/aarch64/sysdep.h:29, > from support_path_support_time64.c:24: > support_path_support_time64.c: In function > =E2=80=98support_path_support_time64=E2=80=99: ../include/time.h:180:24: = error: > implicit declaration of function =E2=80=98__utimensat=E2=80=99; did you m= ean > =E2=80=98utimensat=E2=80=99? [-Werror=3Dimplicit-function-declaration] 18= 0 | # define > __utimensat64 __utimensat | ^~~~~~~~~~~ > support_path_support_time64.c:43:7: note: in expansion of macro > =E2=80=98__utimensat64=E2=80=99 43 | if (__utimensat64 (AT_FDCWD, path,= &tsp[0], 0) > =3D=3D -1) >=20 >=20 > I will commit the following fix: >=20 > diff --git a/support/support_path_support_time64.c > b/support/support_path_support_time64.c index 74af7d4973..452fedcde5 > 100644 --- a/support/support_path_support_time64.c > +++ b/support/support_path_support_time64.c > @@ -31,7 +31,7 @@ utimesat_call (const char *path, const struct > __timespec64 tsp[2]) # ifndef __NR_utimensat_time64 > # define __NR_utimensat_time64 __NR_utimensat > # endif > - return INLINE_SYSCALL_CALL (utimensat_time64, AT_FDCWD, path, > &tsp[0], 0); > + return syscall (__NR_utimensat_time64, AT_FDCWD, path, &tsp[0], 0); > } > #endif > =20 I've checked it with ARM 32 bit. It works without issues. Thanks for providing this proper fix. Tested-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_/_y/8_E5Si08SBzrDgTGu9v= Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAmBSg5cACgkQAR8vZIA0 zr2zlQf/dxFAON1qzmBEqtBRfFISdwbi0nP0gqzIKqV3wGov4mZppZceGayictHU 9kMek143POhU7K2PgoQj147WiusQzWJ9w4adMdE3ac9KgjABk1d9oaF4lZnnGSSP e3+q60LOgjB2VhOfb46veuTymGltoGEWlhBiTg4GpZznT2piFMGEBJtTxkh2Xq9P sXsym3z493a8SLokbzM0wbH50pUHWhZ4qwtu5UHli1FvUt+vau8dCmwHDpKPiDC7 TBj7zDI5TfbmBSiBRnsQ4tMelUHv2GR7Mxow/ILxFruJGJGXZAqmLXBWVntSjiL7 3bfsBdjcNfJ5qEKv/8hpt2wfI5IFJw== =NfLr -----END PGP SIGNATURE----- --Sig_/_y/8_E5Si08SBzrDgTGu9v=--