This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH 1/4] Avoid duplication of _CLOEXEC and _NONBLOCK values
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Guy Martin <gmsoft at tuxicoman dot be>
- Cc: libc-ports at sourceware dot org, carlos at systemhalted dot org
- Date: Sat, 21 Aug 2010 20:47:00 +0000 (UTC)
- Subject: Re: [PATCH 1/4] Avoid duplication of _CLOEXEC and _NONBLOCK values
- References: <1282416480-14238-1-git-send-email-gmsoft@tuxicoman.be>
On Sat, 21 Aug 2010, Guy Martin wrote:
> This patch avoid duplicating files where _CLOEXEC and _NONBLOCK values are defined.
> It creates new files for all the ports arch. They are a copy from the mainline glibc
> but instead of redefining the value of _CLOEXEC and _NONBLOCK defines, those values
> are taken from fcntl.h which is already arch specific.
This is not namespace-clean; the names in the user namespace that fcntl.h
exports are not permitted to be defined by sys/socket.h (and while the
other headers are GNU extensions so POSIX has nothing to say about their
namespace requirements, they should still not be gratuitously exporting
user namespace symbols from other headers). You'd need a separate bits/
header that defines the relevant names in the implementation namespace
(__O_CLOEXEC and __O_NONBLOCK, for example).
Putting a file directly in sysdeps/unix/sysv/linux/bits/socket.h in ports
also seems rather fragile; it causes the installed headers to depend on
whether the ports add-on is used or not, and for the sake of multilib
configurations such as a Power Architecture compiler supporting both
hard-float (libc) and soft-float (ports) libraries it's desirable to avoid
such differences within the same target architecture even when it has both
libc and ports variants. As such, I don't think it makes sense to try to
change this without libc buy-in (the same issue of different O_* values
affects SPARC, it's not just a ports issue).
--
Joseph S. Myers
joseph@codesourcery.com