From patchwork Wed Dec 8 14:47:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 48630 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AB51B3858428 for ; Wed, 8 Dec 2021 14:49:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB51B3858428 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638974996; bh=xZW+3+BVeYEnveVSa5kk2N9IetWkSVGT0vWxLWteJh4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=BQyaqtciaGeCMLLUjqTpFjPduSw05rk/IwAdwuHZtZogOlDFLAZwwGV3y/BmrAMnC vpxEovo/gtySNMMiAEmunSwU8OcAhYJKwp8p3kMWbWX6G1cgQrPCMTH9tZH03bW9o7 hff19U0F1yvEyVN4ox01HPxkhmaQ/a0kAOPkAvx8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 55BF73858D3C for ; Wed, 8 Dec 2021 14:49:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 55BF73858D3C Received: by mail-wr1-x42d.google.com with SMTP id c4so4471684wrd.9 for ; Wed, 08 Dec 2021 06:49:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xZW+3+BVeYEnveVSa5kk2N9IetWkSVGT0vWxLWteJh4=; b=bcKB3tFCORgpDe0GlSIQ3CLRfW6Tntx1DNzH8iiawX8KBJe6eXakqmQ5ArxqyP+t46 uJYKBHkaO3y31GKRjAN08nf5Kp9RlInQa5XOMdpxiu2bF6Qw5VBTM13GbZqI5G1zTO0w naWIRmMxD0rUQWIR/OyEqhJ7Q5ZnDKYi8bFHeVrDDDFg14iKmgHTwLP5IeRX45Bnk6U6 aalSKreizRg/Mjb8hlmFmXEkcdSAT11unLlZ4wgWC1vM+K6Kab8vhgPw9QEePSyaEbyl q9VtWmmwHCo4LpQhmBhv8dD9URdkPCxbkV9uyZtu997cFjplGx4fimj1LY8QfeLtOgAw g3jA== X-Gm-Message-State: AOAM531CdHHOJnzeBRwpgPLCcGWxO1cRxFzdwDx2cTHHwM2qS5QUa8ib oQiU+jrFHlDQkLpldncWlLaAwDI58zM= X-Google-Smtp-Source: ABdhPJzi6rAJMZaA7p5saKCDYlEbDEw6e2JBB6qFLjgmPom+So/hk0DXXqLOzlFXYG6nEaz9lr255w== X-Received: by 2002:adf:f489:: with SMTP id l9mr61232278wro.268.1638974973492; Wed, 08 Dec 2021 06:49:33 -0800 (PST) Received: from sqli.sqli.com ([195.53.121.100]) by smtp.googlemail.com with ESMTPSA id a9sm2990660wrt.66.2021.12.08.06.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Dec 2021 06:49:32 -0800 (PST) To: libc-alpha@sourceware.org Subject: [RFC v3 1/3] bits/types[izes].h: Define new internal type: __snseconds_t Date: Wed, 8 Dec 2021 15:47:56 +0100 Message-Id: <20211208144757.37641-1-alx.manpages@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211207111957.8087-1-alx.manpages@gmail.com> References: <20211207111957.8087-1-alx.manpages@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-Patchwork-Original-From: Alejandro Colomar via Libc-alpha From: Alejandro Colomar Reply-To: Alejandro Colomar Cc: Alejandro Colomar , Rich Felker , Stefan Puiu , Andreas Schwab , Michael Kerrisk , =?utf-8?b?0L3QsNCx?= , Jakub Wilk , Joseph Myers Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Based on the existing suseconds_t type, with the difference that __snseconds_t should be long when possible. The timespec(3) structure uses long for tv_nsec, except if __x86_64__ && __ILP32__, in which case it uses long long. Add __snseconds_t to allow simplifying the definition of struct timespec. Link: linux-man Link: glibc Cc: наб Cc: Jakub Wilk Cc: Zack Weinberg Cc: Stefan Puiu Cc: Michael Kerrisk (man-pages) Cc: H.J. Lu Cc: Joseph Myers Cc: Rich Felker Cc: Andreas Schwab Cc: Paul Eggert Signed-off-by: Alejandro Colomar --- bits/typesizes.h | 1 + posix/bits/types.h | 1 + sysdeps/mach/hurd/bits/typesizes.h | 1 + sysdeps/unix/sysv/linux/alpha/bits/typesizes.h | 1 + sysdeps/unix/sysv/linux/generic/bits/typesizes.h | 1 + sysdeps/unix/sysv/linux/s390/bits/typesizes.h | 1 + sysdeps/unix/sysv/linux/sparc/bits/typesizes.h | 1 + sysdeps/unix/sysv/linux/x86/bits/typesizes.h | 1 + 8 files changed, 8 insertions(+) diff --git a/bits/typesizes.h b/bits/typesizes.h index 63564b2fa1..85c093fabb 100644 --- a/bits/typesizes.h +++ b/bits/typesizes.h @@ -51,6 +51,7 @@ #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SLONGWORD_TYPE #define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE diff --git a/posix/bits/types.h b/posix/bits/types.h index 2dc63de5c2..c4107f1458 100644 --- a/posix/bits/types.h +++ b/posix/bits/types.h @@ -161,6 +161,7 @@ __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */ __STD_TYPE __USECONDS_T_TYPE __useconds_t; /* Count of microseconds. */ __STD_TYPE __SUSECONDS_T_TYPE __suseconds_t; /* Signed count of microseconds. */ __STD_TYPE __SUSECONDS64_T_TYPE __suseconds64_t; +__STD_TYPE __SNSECONDS_T_TYPE __snseconds_t; /* Signed count of nanoseconds. */ __STD_TYPE __DADDR_T_TYPE __daddr_t; /* The type of a disk address. */ __STD_TYPE __KEY_T_TYPE __key_t; /* Type of an IPC key. */ diff --git a/sysdeps/mach/hurd/bits/typesizes.h b/sysdeps/mach/hurd/bits/typesizes.h index 36adbe09c4..558f9ee597 100644 --- a/sysdeps/mach/hurd/bits/typesizes.h +++ b/sysdeps/mach/hurd/bits/typesizes.h @@ -51,6 +51,7 @@ #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SLONGWORD_TYPE #define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE diff --git a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h index 9bdc925168..d17131cf25 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/typesizes.h @@ -50,6 +50,7 @@ #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __S64_TYPE #define __SUSECONDS64_T_TYPE __S64_TYPE +#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE diff --git a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h index c658dfdf60..bb5276b103 100644 --- a/sysdeps/unix/sysv/linux/generic/bits/typesizes.h +++ b/sysdeps/unix/sysv/linux/generic/bits/typesizes.h @@ -64,6 +64,7 @@ #define __CLOCK_T_TYPE __SLONGWORD_TYPE #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE diff --git a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h index 82e77e1e03..c2ba225750 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/typesizes.h +++ b/sysdeps/unix/sysv/linux/s390/bits/typesizes.h @@ -51,6 +51,7 @@ #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SLONGWORD_TYPE #define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE diff --git a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h index 7aaca9757d..cebc057109 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/typesizes.h @@ -51,6 +51,7 @@ #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __S32_TYPE #define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __SNSECONDS_T_TYPE __SLONGWORD_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE diff --git a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h index 060af056f8..e668755fca 100644 --- a/sysdeps/unix/sysv/linux/x86/bits/typesizes.h +++ b/sysdeps/unix/sysv/linux/x86/bits/typesizes.h @@ -65,6 +65,7 @@ #define __USECONDS_T_TYPE __U32_TYPE #define __SUSECONDS_T_TYPE __SYSCALL_SLONG_TYPE #define __SUSECONDS64_T_TYPE __SQUAD_TYPE +#define __SNSECONDS_T_TYPE __SYSCALL_SLONG_TYPE #define __DADDR_T_TYPE __S32_TYPE #define __KEY_T_TYPE __S32_TYPE #define __CLOCKID_T_TYPE __S32_TYPE