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-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 194631F45E for ; Sat, 15 Feb 2020 14:03:44 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type; q=dns; s=default; b=h0wcs S0i5wnWN2somyWscGkGypbkQ7F3Xv/DUNQfJzoa4q91rmlB2D0JTfBhIaB+y74ea KnAaw1wicys/GAAL5UQ+uwl8RBcLTSKcLxnh73sKmHiqvns1kXAMtzLM09icrB4B /ox6dWcTsZtq/IbAXY4F6t4Dggtl7xlUC0jhmU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type; s=default; bh=/VyiELEqvGY mJmC5BUHKaNNt7ZA=; b=ll7jZyT4ts9iUTzAaFvZyEhlAdndl66xqALefspRLon 6rHXSV69mNAE9Wgal8Q7uajNLUjPSHmXxPH035DvA2OX7kaoEp3rkX3O0Yw2cRsI D+Chnq3vPiLtdVbwSrrIDNUKdIjn2m0tAfERF5+XQwUSej2qWHdhjzGF0WJixbCc = Received: (qmail 29861 invoked by alias); 15 Feb 2020 14:03:41 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 29453 invoked by uid 89); 15 Feb 2020 14:03:40 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-out.m-online.net Date: Sat, 15 Feb 2020 15:03:34 +0100 From: Lukasz Majewski To: Alistair Francis Cc: libc-alpha@sourceware.org, alistair23@gmail.com Subject: Re: [PATCH v3 4/8] sysv: Define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 Message-ID: <20200215150334.233d3472@jawa> In-Reply-To: <20200214163134.31601-5-alistair.francis@wdc.com> References: <20200214163134.31601-1-alistair.francis@wdc.com> <20200214163134.31601-5-alistair.francis@wdc.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/=wzmgpO+.q=nYd1C_2+nbX0"; protocol="application/pgp-signature" --Sig_/=wzmgpO+.q=nYd1C_2+nbX0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 14 Feb 2020 08:31:30 -0800 Alistair Francis wrote: > On y2038 safe 32-bit systems the Linux kernel expects itimerval > and rusage to use a 32-bit time_t, even though the other time_t's > are 64-bit. >=20 > There are also other occurances where the time passed to the kernel > via timeval doesn't match the wordsize. >=20 > To handle these cases let's define a new macro > __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64. This macro specifies if the > kernel's old_timeval matches the new timeval64. This should be true > for 64-bit architectures (expect for Alpha) and x32. Reviewed-by: Lukasz Majewski > --- > bits/typesizes.h | 6 ++++++ > sysdeps/unix/sysv/linux/alpha/bits/typesizes.h | 3 +++ > sysdeps/unix/sysv/linux/generic/bits/typesizes.h | 7 +++++++ > sysdeps/unix/sysv/linux/s390/bits/typesizes.h | 6 ++++++ > sysdeps/unix/sysv/linux/sparc/bits/typesizes.h | 6 ++++++ > sysdeps/unix/sysv/linux/x86/bits/typesizes.h | 3 +++ > 6 files changed, 31 insertions(+) >=20 > diff --git a/bits/typesizes.h b/bits/typesizes.h > index 599408973e..8f16903a21 100644 > --- a/bits/typesizes.h > +++ b/bits/typesizes.h > @@ -76,10 +76,16 @@ > =20 > /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ > # define __STATFS_MATCHES_STATFS64 1 > + > +/* And for getitimer, setitimer and rusage */ > +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 > #else > # define __RLIM_T_MATCHES_RLIM64_T 0 > =20 > # define __STATFS_MATCHES_STATFS64 0 > + > +/* And for getitimer, setitimer and rusage */ > +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 > #endif > =20 > /* Number of descriptors that can fit in an `fd_set'. */ > diff --git a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h > b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h index > 28ee3e5920..e5d7774468 100644 --- > a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h +++ > b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h @@ -73,6 +73,9 @@ > /* Not for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ > # define __STATFS_MATCHES_STATFS64 0 > =20 > +/* And for getitimer, setitimer and rusage */ > +#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 > + > /* Number of descriptors that can fit in an `fd_set'. */ > #define __FD_SETSIZE 1024 > =20 > diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h > b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h index > 7c963e523e..48727c1da7 100644 --- > a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h +++ > b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h @@ -77,11 +77,18 @@ > =20 > /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ > # define __STATFS_MATCHES_STATFS64 1 > + > +/* And for getitimer, setitimer and rusage */ > +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 > #else > # define __RLIM_T_MATCHES_RLIM64_T 0 > =20 > # define __STATFS_MATCHES_STATFS64 0 > + > +/* And for getitimer, setitimer and rusage */ > +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 > #endif > + > /* Number of descriptors that can fit in an `fd_set'. */ > #define __FD_SETSIZE 1024 > =20 > diff --git a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h > b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h index > e775e460bb..2bc87c1079 100644 --- > a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h +++ > b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h @@ -82,10 +82,16 @@ > =20 > /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ > # define __STATFS_MATCHES_STATFS64 1 > + > +/* And for getitimer, setitimer and rusage */ > +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 > #else > # define __RLIM_T_MATCHES_RLIM64_T 0 > =20 > # define __STATFS_MATCHES_STATFS64 0 > + > +/* And for getitimer, setitimer and rusage */ > +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 > #endif > =20 > /* Number of descriptors that can fit in an `fd_set'. */ > diff --git a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h > b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h index > ac48c23e37..288a902b5f 100644 --- > a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h +++ > b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h @@ -76,10 +76,16 @@ > =20 > /* And for fsblkcnt_t, fsblkcnt64_t, fsfilcnt_t and fsfilcnt64_t. */ > # define __STATFS_MATCHES_STATFS64 1 > + > +/* And for getitimer, setitimer and rusage */ > +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 > #else > # define __RLIM_T_MATCHES_RLIM64_T 0 > =20 > # define __STATFS_MATCHES_STATFS64 0 > + > +/* And for getitimer, setitimer and rusage */ > +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 > #endif > =20 > /* Number of descriptors that can fit in an `fd_set'. */ > diff --git a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h > b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h index > 87c50a4f32..f68dfecc90 100644 --- > a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h +++ > b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h @@ -94,6 +94,9 @@ > # define __STATFS_MATCHES_STATFS64 0 > #endif > =20 > +/* And for getitimer, setitimer and rusage */ > +#define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 > + > /* Number of descriptors that can fit in an `fd_set'. */ > #define __FD_SETSIZE 1024 > =20 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_/=wzmgpO+.q=nYd1C_2+nbX0 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEgAyFJ+N6uu6+XupJAR8vZIA0zr0FAl5H+jYACgkQAR8vZIA0 zr3A4Af/TVj14dGr9Wi2vJROzO1xZHJBrRhQxGpLVNf47j08MsTtH1fjSbS4SGI1 FV3tv59U7+7BIDw6b3nX8jfxwt+aGM7ocOc9R8lxRNB7mG4RVIRFTP5x+ALOOBNe OYwcvjxOaOZDRWooCyg/rA94ENuKKlKjF4crvZa4l2iEzUOHX+TrDJQFZ523Gthj hV7YqROl2JOOmpJTSa1q7Mu2nNW2vq5uSyX/OegE5MTj6yc20kvrCtLOch7FTHdI U5PGemhrFKvrjbDg0gyHCTtBCZJlMkBE63GMN0pfhxxv9fnifF+A1I7ebbyRfCUU +zvsg26nZo//PLnGmjhv+3T/nzmLng== =BrXV -----END PGP SIGNATURE----- --Sig_/=wzmgpO+.q=nYd1C_2+nbX0--