This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Continuing the UAPI split
- From: Florian Weimer <fweimer at redhat dot com>
- To: Christian Brauner <christian dot brauner at ubuntu dot com>
- Cc: Elichai Turkel <elichai dot turkel at gmail dot com>, linux-api at vger dot kernel dot org, libc-alpha <libc-alpha at sourceware dot org>
- Date: Thu, 07 Nov 2019 13:10:53 +0100
- Subject: Re: Continuing the UAPI split
- References: <CALN7hCK0EXLXjPRPr+tuuF2-uQvkLMCFDNzGhv9HS-jrAz6Hmg@mail.gmail.com> <0B17C6F2-DC2B-4192-B4AD-BD11D6B9F2B6@ubuntu.com>
* Christian Brauner:
> [+Cc Florian, glibc]
>
> On November 7, 2019 12:17:50 PM GMT+01:00, Elichai Turkel <elichai.turkel@gmail.com> wrote:
>>Hi,
>>I'm working on a library that calls syscalls directly to the kernel.
>>`make hedears_install` is a great command to auto generate the UAPI
>>headers that are needed to call the kernel.
>>
>>But the headers are still missing a bunch of defines for flags and
>>structs.
>>
>>I wanted to know if patches to move more things from `./include/linux`
>>to `./include/uapi/linux` are welcome (obviously only
>>typedefs/defines/structs that are required for the syscalls)
>>
>>I think the UAPI is really close to getting a complete set of things
>>needed to communicate with the syscalls, but still not quite there. I
>>would like to push patches whenever I see missing things that my
>>library needs (that way it will be incrementally and by usage only).
The kernel uses some POSIX names with POSIX-incompatible definitions,
e.g. struct msghdr. Some libcs prioritize POSIX conformance over kernel
conformance and implement userspace translation for mismatch types.
When building against such libcs, it becomes difficult to use UAPI and
libc headers in a single translation unit. (It is already difficult
today in some cases.)
I don't know a good solution here. Not using POSIX names in UAPI
headers is one option. Previously, we have tried to use preprocessor
macros to coordinate definitions, but did not work well in practice
(only few conflicts were ever resolved). It does not help at all when
the definitions are incompatible.
Thanks,
Florian