From patchwork Wed Feb 19 18:10:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 38238 Received: (qmail 5179 invoked by alias); 19 Feb 2020 18:18:07 -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 Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 4991 invoked by uid 89); 19 Feb 2020 18:18:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: esa2.hgst.iphmx.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1582136306; x=1613672306; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=z3loL2a/EvDpFCOOlJrYHVu+0Xbx6Mh/QaH/0puf9RE=; b=c1sc0vpuTy/JlGv9H2uC7GxUE9f9d9PoPTuyQQZ/nTzqYJtJWX8S/rh7 rjf/b5VA3Zi+2K6BzwGIy3dAsClyNxsicFXFRitgRJp01uV+SSh3uA2hq p2sxo5tPe/bSk2WsNgqhXcUhpyOEytJiu1Jb3/wsroClKsEdWz6kMy1JN rZLgJY0AVs3Bd3JiaL63Xz4RZTSgi7lMbWRTtB6osGa65+7/TkJo77nkW VCB0O7VWXwgLmlFA67PE/muxE5svIy7roVDzy5ks+AzpScffAOEKimrX7 ZQ6SxVI+eRp/Jd/l6a0nHZf/rI/k+Hz4JgxEwTgN2ivdGNP2HNiLvC1yq g==; IronPort-SDR: yUSfLM4a3PBEuB5regM6T6mPKOg1FKTraLsRr/2Kp6GWYh5ELKMwKpXTUeuQqKDCdXIzd5UtF6 1BJ8VG8pk6vi3XM03AslfRVnmbx9pkrEGRm2tQ6uh6JQy/1z4liaHBmLuO6MMmQpC+AGXoDI0q 8omDLyBz2NKWvSGDSBx4rGV2DHZ513SUqn0LdoZtnCTdVlYyz++vYgKArRSauVU1N96773Vk90 67SIFgAbbI8oixBoJmV8n3hpTqepvMd3+kfp0q4VlU648ix6YcNIFAqLGpvQQGm6DcAu/LpTIB xM8= IronPort-SDR: gzGD+cVQAe1uCLU1YSrCjL+0uxwfOb3A0Ye8JPmJPNooLFbHhwuGX961v9Hm5UBZ1LRsqE+KsI JafvluY8DQEtiaSqNfcCwUHA2hhZr0yitVS6lM4q7qn4eY9NRWO5WpcBU/be8Cz/tmecj63FT1 0iCEedgF/pH2g1kYL/T8KT4kq8m2r/QmM7v4LfMCMKupYFeBLj4YS05iSmR8dqpXgTAVZ8f31y AGZ60f0nx0lDeOE5iJ4NmcJZpcxTBlYKFBQRIqGZnqAPclJja2wmGCwCkPoaDtkVZvt9tXOilz RKGbJPSwRsuXRVFqcBlWzSch IronPort-SDR: uGTIKzrjK6DNmZhjvMK8I70obBw94jpNPrweu9z8fBr6kWAZe6UNXI1QUHF7b2oMl7olDdirMr jPr+L7YcMMuHBbU1RvVuDzDoAj95fMZsLO1iP+rJAMpDTn1WKz+VYaqPQrOA8AInFY8jARyvxQ D96WTWKcnG/OYQv+XA6o3dkl5O1s/87Rk769EyUZVrtdfAtM4CiSIcbl9AVT9831sX5Jc3bZNB 8lcbAyMtNUZUDxAkl4xkoou/OjOUpRoSaBZsU/fZ6Gf1csjE+Gmmw0R8aMuErrqEa5feeHXNKX xjI= WDCIronportException: Internal From: Alistair Francis To: libc-alpha@sourceware.org Cc: alistair23@gmail.com, Alistair Francis , Lukasz Majewski Subject: [PATCH v4 4/8] sysv: Define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 Date: Wed, 19 Feb 2020 10:10:53 -0800 Message-Id: <20200219181057.10297-5-alistair.francis@wdc.com> In-Reply-To: <20200219181057.10297-1-alistair.francis@wdc.com> References: <20200219181057.10297-1-alistair.francis@wdc.com> MIME-Version: 1.0 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. There are also other occurances where the time passed to the kernel via timeval doesn't match the wordsize. 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 | 6 ++++++ 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, 30 insertions(+) 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 @@ /* 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 # 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'. */ 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 +/* 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 diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h index 7c963e523e..4fb246ac74 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h +++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h @@ -77,11 +77,17 @@ /* 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 # define __STATFS_MATCHES_STATFS64 0 + +# define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 0 #endif + /* Number of descriptors that can fit in an `fd_set'. */ #define __FD_SETSIZE 1024 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 @@ /* 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 # 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'. */ 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 @@ /* 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 # 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'. */ 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 +/* 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