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.7 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 E486F1F4B4 for ; Fri, 16 Oct 2020 09:14:59 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 06C643953D14; Fri, 16 Oct 2020 09:14:59 +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 7B220386F461 for ; Fri, 16 Oct 2020 09:14:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7B220386F461 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 4CCL8G4ctfz1qs3s; Fri, 16 Oct 2020 11:14:54 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CCL8G4FKGz1qtYx; Fri, 16 Oct 2020 11:14:54 +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 ZWiNJIn2tuwl; Fri, 16 Oct 2020 11:14:49 +0200 (CEST) X-Auth-Info: uE11eT1xx/U5LrBvNTUTvuHuK5IZzN9SgMRRRKNpa0c= 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, 16 Oct 2020 11:14:49 +0200 (CEST) Date: Fri, 16 Oct 2020 11:14:41 +0200 From: Lukasz Majewski To: Adhemerval Zanella Subject: Re: [PATCH 3/3] linux: Add 64-bit time_t support for wait3 Message-ID: <20201016111441.2676a9f8@jawa> In-Reply-To: <20201015130632.90961-3-adhemerval.zanella@linaro.org> References: <20201015130632.90961-1-adhemerval.zanella@linaro.org> <20201015130632.90961-3-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_/D2TLUjE5awQe.vbuYQsh083"; 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: libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" --Sig_/D2TLUjE5awQe.vbuYQsh083 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Adhemerval, > It basically calls the 64-bit time_t wait4 internal symbol. >=20 > Checked on x86_64-linux-gnu and i686-linux-gnu. > --- > include/sys/resource.h | 4 +++ > sysdeps/unix/sysv/linux/wait3.c | 44 > +++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) > create mode 100644 sysdeps/unix/sysv/linux/wait3.c >=20 > diff --git a/include/sys/resource.h b/include/sys/resource.h > index 64925f257c..2235b020fc 100644 > --- a/include/sys/resource.h > +++ b/include/sys/resource.h > @@ -138,12 +138,16 @@ libc_hidden_proto (__setrlimit); > #if __TIMESIZE =3D=3D 64 > # define __getrusage64 __getrusage > # define __wait4_time64 __wait4 > +# define __wait3_time64 __wait3 > #else > extern int __getrusage64 (enum __rusage_who who, struct __rusage64 > *usage); libc_hidden_proto (__getrusage64) > extern pid_t __wait4_time64 (pid_t pid, int *stat_loc, int options, > struct __rusage64 *usage); > libc_hidden_proto (__wait4_time64) > +extern pid_t __wait3_time64 (int *stat_loc, int options, > + struct __rusage64 *usage); > +libc_hidden_proto (__wait3_time64) > #endif > #endif > #endif > diff --git a/sysdeps/unix/sysv/linux/wait3.c > b/sysdeps/unix/sysv/linux/wait3.c new file mode 100644 > index 0000000000..c05776f7ab > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/wait3.c > @@ -0,0 +1,44 @@ > +/* Wait for process to change state, BSD style. Linux version. > + Copyright (C) 2020 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be > useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +#include > +#include > +#include > + > +pid_t > +__wait3_time64 (int *stat_loc, int options, struct __rusage64 *usage) > +{ > + return __wait4_time64 (WAIT_ANY, stat_loc, options, usage); > +} > +#if __TIMESIZE !=3D 64 > +libc_hidden_def (__wait3_time64) > + > +pid_t > +__wait3 (int *stat_loc, int options, struct rusage *usage) > +{ > + struct __rusage64 usage64; > + pid_t ret =3D __wait3_time64 (stat_loc, options, > + usage !=3D NULL ? &usage64 : NULL); > + if (ret > 0 && usage !=3D NULL) > + rusage64_to_rusage (&usage64, usage); > + > + return ret; > +} > +#endif > + > +weak_alias (__wait3, wait3) Thanks for converting this. Reviewed-by: Lukasz Majewski Side comment: ------------- Now, I've just realized that struct __rusage64 (defined in non-exported header: include/sys/resource.h) also needs to be exported for proper Y2038 support (the same case as with struct __stat64_t64). 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_/D2TLUjE5awQe.vbuYQsh083 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAl+JZIEACgkQAR8vZIA0 zr1QAAgAzGHl/K8epk4VKWKXnGER3Blu1Ci/TlRITS6qN3/wdhOrGpxJzhBHtGUp tvRkVjDLEh0pllgMj25O5iJfDXHE06cNpTxj1c1Yz1GZUD2KVar+KhaydiO+pSGG MDETlDTrs2/mVJh33nucOVO/zq6qyqSq5OTOOKHs42jDFuDjK3XONeesMqs/6YAo Xpa/irsynivq9VYzTg9MhlzZZxUJVgIRbd1EfgKal3iqSbrrP5IFybEH9cbfAFh7 GGFYdMyyB1I9fkeOjKeghQnN5ymW0LjLNyXLzJmwQ5Ai+GIuyMwkj3GIxj+LExJY gm/X4RtjIpv6ks75kHNhxJW7W8tzAQ== =SbtO -----END PGP SIGNATURE----- --Sig_/D2TLUjE5awQe.vbuYQsh083--