This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/3] Avoid duplication of _CLOEXEC and _NONBLOCK values
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Guy Martin <gmsoft at tuxicoman dot be>
- Cc: libc-help at sourceware dot org
- Date: Fri, 13 Aug 2010 14:43:03 -0400
- Subject: Re: [PATCH 1/3] Avoid duplication of _CLOEXEC and _NONBLOCK values
- References: <1281378099-8878-1-git-send-email-gmsoft@tuxicoman.be>
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.