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: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, PDS_RDNS_DYNAMIC_FP,RCVD_IN_DNSWL_HI,RDNS_DYNAMIC,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (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 97EE01F953 for ; Mon, 22 Nov 2021 22:21:12 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 78534385802A for ; Mon, 22 Nov 2021 22:21:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 78534385802A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1637619671; bh=FCiOZI9Dv20tAQ/7weQX2U+Lw8g5MWMQEAl+y42pkKY=; h=In-Reply-To:References:Date:To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=vjVmJktN2YatBsR0ikCodk78De4W9ro/9w7wLuQslo+WwbTZBITElnUB7G7axXSZu Gv6Ll+x63SOrzI5KDUWubCukwFt1tq/qvdotsyKiUiy1lbc5Vz/Dc/V50mHWj6UCjq qaQeD5NyKkNifHGHvbHX65uLun224n6n7DhZMB6M= Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by sourceware.org (Postfix) with ESMTPS id DFC6B3858409 for ; Mon, 22 Nov 2021 22:20:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DFC6B3858409 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id F04595C0216; Mon, 22 Nov 2021 17:20:49 -0500 (EST) Received: from imap45 ([10.202.2.95]) by compute5.internal (MEProxy); Mon, 22 Nov 2021 17:20:49 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrgeeggdduiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdgkrggt khcuhggvihhnsggvrhhgfdcuoeiirggtkhesohiflhhfohhlihhordhorhhgqeenucggtf frrghtthgvrhhnpefhuefhveeuffetfffgjeetgfekkeehfedtfeelgfehffffveehkeel fefgheffudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpeiirggtkhesohiflhhfohhlihhordhorhhg X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5B74024A0079; Mon, 22 Nov 2021 17:20:49 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-1371-g2296cc3491-fm-20211109.003-g2296cc34 Mime-Version: 1.0 Message-Id: In-Reply-To: References: Date: Mon, 22 Nov 2021 22:19:59 +0000 To: "Cyril Hrubis" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] uapi: Make __{u,s}64 match {u,}int64_t in userspace Content-Type: text/plain 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: , From: Zack Weinberg via Libc-alpha Reply-To: Zack Weinberg Cc: linux-arch@vger.kernel.org, linux-api@vger.kernel.org, libc-alpha@sourceware.org, ltp@lists.linux.it Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Mon, Nov 22, 2021, at 4:43 PM, Cyril Hrubis wrote: > This changes the __u64 and __s64 in userspace on 64bit platforms from > long long (unsigned) int to just long (unsigned) int in order to match > the uint64_t and int64_t size in userspace. ... > + > +#include > + > /* > - * int-ll64 is used everywhere now. > + * int-ll64 is used everywhere in kernel now. > */ > -#include > +#if __BITS_PER_LONG == 64 && !defined(__KERNEL__) > +# include > +#else > +# include > +#endif I am all for matching __uN / __sN to uintN_t / intN_t in userspace, but may I suggest the technically simpler and guaranteed-to-be-accurate /* - * int-ll64 is used everywhere now. + * int-ll64 is used everywhere in kernel now. + * In user space match . */ +#ifdef __KERNEL__ # include +#elif __has_include () +# include +typedef __int8_t __s8; +typedef __uint8_t __u8; +typedef __int16_t __s16; +typedef __uint16_t __u16; +typedef __int32_t __s32; +typedef __uint32_t __u32; +typedef __int64_t __s64; +typedef __uint64_t __u64; +#else +# include +typedef int8_t __s8; +typedef uint8_t __u8; +typedef int16_t __s16; +typedef uint16_t __u16; +typedef int32_t __s32; +typedef uint32_t __u32; +typedef int64_t __s64; +typedef uint64_t __u64; +#endif The middle clause could be dropped if we are okay with all uapi headers potentially exposing the non-implementation-namespace names defined by . I do not know what the musl libc equivalent of is. zw