This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libc-compat.h for <bits/fcntl-linux.h>

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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]