[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <b8d6f890-e5aa-44bf-8a55-5998efa05967@www.fastmail.com>
Date: Thu, 02 Dec 2021 09:55:20 -0500
From: "Zack Weinberg" <zack@...folio.org>
To: "Arnd Bergmann" <arnd@...db.de>, "Cyril Hrubis" <chrubis@...e.cz>
Cc: "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
libc-alpha@...rceware.org,
"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"David Howells" <dhowells@...hat.com>,
"David Laight" <David.Laight@...lab.com>,
"ltp@...ts.linux.it" <ltp@...ts.linux.it>
Subject: Re: [PATCH] uapi: Make __{u,s}64 match {u,}int64_t in userspace
On Mon, Nov 29, 2021, at 9:34 AM, Arnd Bergmann wrote:
> On Mon, Nov 29, 2021 at 12:58 PM Cyril Hrubis <chrubis@...e.cz> wrote:
>>
>> What about guarding the change with __STDINT_COMPATIBLE_TYPES__
In user space, I don't see a compelling need for backward compatibility? User space's expectation is that the types are *already* the same and we (glibc) regularly get bug reports because they aren't.
I could be persuaded otherwise with an example of a program for which changing
__s64 from 'long long' to 'long' would break *binary* backward compatibility, or
similarly for __u64.
> I don't think we can include stdint.h here, the entire point of the custom
> kernel types is to ensure the other kernel headers can use these types
> without relying on libc headers.
If __KERNEL__ is not defined, though, there should be no issue, right?
>From user space's perspective, it's an ongoing source of problems whenever __uN isn't exactly the same "underlying type" as uintN_t, same for __sN and intN_t. We would really like it if the uapi headers, when included from user space, deferred to the C library for the definitions of these types.
<stdint.h> does define a lot of things beyond just the fixed-width types, and it defines names in the application namespace (i.e. with no __ prefix). Perhaps we could come to some agreement on a private header, provided by libcs, that *only* defined __{u,}int{8,16,32,64}_t. glibc already has <bits/types.h> which promises
to define only __-prefix names, but it defines a lot of other types as well (__dev_t, __uid_t, __pid_t, __time_t, etc etc etc).
zw
Powered by blists - more mailing lists