Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EEB8C433EF for ; Tue, 23 Nov 2021 19:50:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240204AbhKWTyB (ORCPT ); Tue, 23 Nov 2021 14:54:01 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:28810 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240114AbhKWTxt (ORCPT ); Tue, 23 Nov 2021 14:53:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637697040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4KI1H93I3xG9XwZuvC9rCCKf5tSl7Lx4nyuD6OnlcLQ=; b=GA+tbWdr4oYUXpTwcFRF7o07nzWDgPQyZtum+JnfdABO14FXvxGYQdGN3LCSfDRnzis/IL xMx+ev5Se1I7fO/vCuN0PpR85+wRAcyOCeLs7CGpNnptxMJaB7w40gG1Z04jaj/lbHwG8W 7KZaRHHjGuEy38qp/i/5SKogb/kwLwk= 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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