From: Zack Weinberg via Libc-alpha <libc-alpha@sourceware.org>
To: "Arnd Bergmann" <arnd@arndb.de>, "Cyril Hrubis" <chrubis@suse.cz>
Cc: "linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
libc-alpha@sourceware.org,
"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
David Howells <dhowells@redhat.com>,
David Laight <David.Laight@aculab.com>,
"ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [PATCH] uapi: Make __{u,s}64 match {u,}int64_t in userspace
Date: Thu, 02 Dec 2021 09:55:20 -0500 [thread overview]
Message-ID: <b8d6f890-e5aa-44bf-8a55-5998efa05967@www.fastmail.com> (raw)
In-Reply-To: <CAK8P3a1Rvf_+qmQ5pyDeKweVOFM_GoOKnG4HA3Ffs6LeVuoDhA@mail.gmail.com>
On Mon, Nov 29, 2021, at 9:34 AM, Arnd Bergmann wrote:
> On Mon, Nov 29, 2021 at 12:58 PM Cyril Hrubis <chrubis@suse.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
next prev parent reply other threads:[~2021-12-02 14:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-22 16:43 [PATCH] uapi: Make __{u,s}64 match {u,}int64_t in userspace Cyril Hrubis
2021-11-22 16:51 ` Alejandro Colomar (mailing lists) via Libc-alpha
2021-11-22 20:48 ` Arnd Bergmann
2021-11-23 9:14 ` Cyril Hrubis
2021-11-23 14:18 ` Arnd Bergmann
2021-11-23 19:50 ` Florian Weimer via Libc-alpha
2021-11-24 10:17 ` Alejandro Colomar (man-pages) via Libc-alpha
2021-11-22 22:19 ` Zack Weinberg via Libc-alpha
2021-11-23 9:15 ` Cyril Hrubis
2021-12-02 15:34 ` Rich Felker
2021-12-02 23:29 ` Rich Felker
2021-12-02 23:43 ` Adhemerval Zanella via Libc-alpha
2021-12-03 0:10 ` Zack Weinberg via Libc-alpha
2021-12-03 12:32 ` Adhemerval Zanella via Libc-alpha
2021-12-03 12:54 ` Alejandro Colomar (man-pages) via Libc-alpha
2021-11-23 16:47 ` David Howells via Libc-alpha
2021-11-23 16:58 ` David Laight via Libc-alpha
2021-11-29 11:58 ` Cyril Hrubis
2021-11-29 14:34 ` Arnd Bergmann
2021-12-02 14:55 ` Zack Weinberg via Libc-alpha [this message]
2021-12-02 15:01 ` David Howells via Libc-alpha
2021-12-02 20:48 ` Zack Weinberg via Libc-alpha
2021-12-08 15:33 ` Cyril Hrubis
2022-06-17 12:13 ` Ping: " Alejandro Colomar via Libc-alpha
2022-06-17 15:04 ` Ping: [PATCH] uapi: Make __{u, s}64 match {u, }int64_t " Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b8d6f890-e5aa-44bf-8a55-5998efa05967@www.fastmail.com \
--to=libc-alpha@sourceware.org \
--cc=David.Laight@aculab.com \
--cc=arnd@arndb.de \
--cc=chrubis@suse.cz \
--cc=dhowells@redhat.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ltp@lists.linux.it \
--cc=zack@owlfolio.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).