From patchwork Tue Mar 3 17:53:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 38388 Received: (qmail 542 invoked by alias); 3 Mar 2020 18:01:23 -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 377 invoked by uid 89); 3 Mar 2020 18:01:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.2 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: esa4.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=1583258479; x=1614794479; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cRuZO2rQDuDGWiwLzf6NgzVt4RCkEkqNkbEiHY14Egw=; b=bPQYn9eV9wqRS22PX2JKQspoyEbrQaJlesHYy4JchwKNDZZ7jp15CrYk 8R6e6qRoeH+CNwxnrBPpJbenB1DPmLlZilUwuhJ8M1CeFhpRHWg4ZOl3j qRhVQrDY8SvM+GpULJ6EBwj5SxeNIg1TfXJksjUqka4Dha3E5uu+ngTIZ 43nNssL2IpwENoamQXPgNQzstueIo997oZG1OYBcYkCPN0S5FuCxwe5V5 aPl39Ce6KHImziQlmuFfooyufZvCVtGBVVWR0x2ZQHa4TX3lSi8lNmDJi 4JA7UNHCO75wPg9ZGNC60bt0ezynPjjt4+4XaiJdUFPLG3uSjaezENFHT w==; IronPort-SDR: LNxlsgO+lwzcVR6xKGLhMjI7pw+fqTRCDxtm2K7TmxozVnW5HgvS8rEkNJ5TIzZKfdrB7kpx2P cYDptC4OeQ/qEWOP5Tb+LdgeER6zeEuxkYn3O3XcsEIQ8SSMJsPwjUW2c1YheqoOlxAuZy8e6y MewPuSJeTG3nUEFuSwgK5g7/LBddocQWfWgg8F6qvmPKrKXZI3L4ivI7BvEBnNB6AaDV+XuU4i 0+T2H0tZvJndaqWA9SeA5nwqR4sbyG5CxD6bdGPjY3WMXqZNR2vEAqM+icC3GZ246A24JoFbzL u0c= IronPort-SDR: y+wki23U/FLEPaeI8HmqU6SlN8H5toJ0FDsMQNgycR3MbMof7ZXEcevR0EgilUHJudPgACbK/o Y8LydoYhVepOA+H3ercmZ7cIzdo01uB0p5b/3dBHTAtQjkYpe6/tl+z5Fg+gnIBvSlyxhRvnH/ Vl38HFChTLcpidbI9sysl5LppWQs8JU8tL7Od3ZV5Ze7XpIXHgC0Iq4LYEF+wyMk/T5TYTa6DA F0wRIY+pRYeqmBSL7MnTzoAIFXIpSmFWRlkUASuput4HsOMpfAYdnoeq+ZzLilQrS+4INCGUIB JWEyAWSHDEsLO+Sui4nGC5z2 IronPort-SDR: msa665o9eUSZTQrTuee2nYhQVvtZsYlk/yWCL8mMwXluYq+UiNYXMpdOOK7gs6bEz90SPoIoE/ K5NNevOcFRwCYa5hPbMrzVATup6a8fDvWRU3d7OTz7Tu8IuHL0Clfo1fk+z2pgtnyBibugeq5K Tw0cEDKopSyktlY5wZalXZNA5hlrsgbKLeYpV6vxkbutK1QBtMRU6ASrFXNTBROOkCfeh5vuQh ys17LRLqK3Ncen/mpcDZyvJKbacZh4vZHspgIMkdr75jY/DXT3dJ92KLzZtz6EF3IRikX12XTY TNo= WDCIronportException: Internal From: Alistair Francis To: libc-alpha@sourceware.org Cc: adhemerval.zanella@linaro.org, Alistair Francis , Lukasz Majewski Subject: [PATCH v5 4/8] sysv: Define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 Date: Tue, 3 Mar 2020 09:53:51 -0800 Message-Id: <20200303175355.15770-5-alistair.francis@wdc.com> In-Reply-To: <20200303175355.15770-1-alistair.francis@wdc.com> References: <20200303175355.15770-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