From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id B973F3858D28 for ; Tue, 23 Nov 2021 19:50:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B973F3858D28 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-263-g8GUzCcIP7q9i3fnOHSj_A-1; Tue, 23 Nov 2021 14:50:37 -0500 X-MC-Unique: g8GUzCcIP7q9i3fnOHSj_A-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7D29818125C1; Tue, 23 Nov 2021 19:50:35 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9DEBB60CC3; Tue, 23 Nov 2021 19:50:33 +0000 (UTC) From: Florian Weimer To: Cyril Hrubis Cc: Arnd Bergmann , Linux Kernel Mailing List , Linux API , LTP List , GNU C Library , linux-arch Subject: Re: [PATCH] uapi: Make __{u,s}64 match {u,}int64_t in userspace References: Date: Tue, 23 Nov 2021 20:50:31 +0100 In-Reply-To: (Cyril Hrubis's message of "Tue, 23 Nov 2021 10:14:15 +0100") Message-ID: <87a6hups6w.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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-List-Received-Date: Tue, 23 Nov 2021 19:50:42 -0000 * Cyril Hrubis: > As far as I can tell the userspace bits/types.h does exactly the same > check in order to define uint64_t and int64_t, i.e.: > > #if __WORDSIZE == 64 > typedef signed long int __int64_t; > typedef unsigned long int __uint64_t; > #else > __extension__ typedef signed long long int __int64_t; > __extension__ typedef unsigned long long int __uint64_t; > #endif > > The macro __WORDSIZE is defined per architecture, and it looks like the > defintions in glibc sources in bits/wordsize.h match the uapi > asm/bitsperlong.h. But I may have missed something, the code in glibc is > not exactly easy to read. __WORDSIZE isn't exactly a standard libc macro. On musl, x86-64 x32 has __WORDSIZE == 64 depending on header-inclusion order, but that's probably just a bug. Thanks, Florian