This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] libc-compat.h for <bits/fcntl-linux.h>
- From: Carlos O'Donell <carlos at redhat dot com>
- To: Eric Neblock <ceneblock at member dot fsf dot org>, libc-alpha at sourceware dot org
- Date: Wed, 11 May 2016 10:15:06 -0400
- Subject: Re: [PATCH] libc-compat.h for <bits/fcntl-linux.h>
- Authentication-results: sourceware.org; auth=none
- References: <589a6293-be0f-4b55-3a0b-2c180773ad94 at member dot fsf dot org>
On 05/08/2016 03:17 PM, Eric Neblock wrote:
> Hello everyone,
> I've been doing some kernel hacking and added some new flags to the
> Linux kernel. I want to use these flags in userland without having to in
> an additional header (<asm-generic/fcntl.h>) and even then, there are
> conflicts, because almost everything is already defined.
> As such, I filed a feature request (20050) and was informed about
> about the process to have compatibility.
> I've attached a patch that shouldn't break anything. Incidentally,
> everything in the Linux Kernel matches what is done by glibc.
> If I need to provide any more information, then please let me know.
You are on the right track.
As Florian pointed out our patch had issues (non-unified and reversed).
As Florian and Andreas point out, Zack's idea of just using the Linux
header won't work because of namespace cleanliness.
I assume the linux side of the patch is here:
The next problem you have is that the glibc fcntl-linux.h header is
conditional on various standard defines. Therefore if the glibc headers
are included first, and some of these standard define are defined, then
you will still get conflicts. So you need to look at those details, for
example O_DIRECTORY is unconditionally defined if you include linux's
header, but it's only defined in some cases for glibc's headers. So if
you include glibc's headers first, then you need to conditionally define
O_DIRECTORY in the linux headers.
So you still have quite a ways to go. As a first submission to Linux
or glibc, you may wish to choose something easier to fix, or find
champions in each community that can help your patch get accepted.
Lastly, please review the contribution checklist: