[PATCH 1/3] Avoid duplication of _CLOEXEC and _NONBLOCK values

Carlos O'Donell carlos@systemhalted.org
Fri Aug 13 18:43:00 GMT 2010


On Mon, Aug 9, 2010 at 2:21 PM, Guy Martin <gmsoft@tuxicoman.be> wrote:
> This patch define all the _CLOEXEC and _NONBLOCK derived values as O_CLOEXEC and
> O_NONBLOCK respectively. This avoids a lot of header duplication and a handfull of
> obsolete files can be removed.
>
> 2010-08-26  Guy Martin <gmsoft@tuxicoman.be>
>        * sysdeps/unix/sysv/linux/bits/socket.h: Define SOCK_CLOEXEC and
>        SOCK_NONBLOCK as O_CLOEXEC and O_NONBLOCK respectively instead of
>        keeping a separate copy for each value.
>        * sysdeps/unix/sysv/linux/sys/epoll.h: Likewise for EPOLL_CLOEXEC and
>        EPOLL_NONBLOCK.
>        * sysdeps/unix/sysv/linux/sys/eventfd.h: Likewise for EFD_CLOEXEC and
>        EFD_NONBLOCK.
>        * sysdeps/unix/sysv/linux/sys/inotify.h: Likewise for IN_CLOEXEC and
>        IN_NONBLOCK.
>        * sysdeps/unix/sysv/linux/sys/signalfd.h: Likewise for SFD_CLOEXEC and
>        SFD_NONBLOCK.
>        * sysdeps/unix/sysv/linux/sys/timerfd.h: Likeswis for TFD_CLOEXEC and
>        TFD_NONBLOCK.

Ulrich has brought up the same comment that Mike brought up, which is
namespace pollution.

Could you define a new header file called "kernel-constants.h" and
include that instead?

Each target must have a copy of kernel-constants.h, but that's all
that needs updating in order to satisfy the uses in the generic
headers.

This would remove the namespace pollution. Could you try out a
solution like that?

Cheers,
Carlos.



More information about the Libc-help mailing list