[PATCH] Use O_CLOEXEC for internal file descriptors

Mark Kettenis mark.kettenis at xs4all.nl
Mon Feb 27 09:11:19 PST 2012


> From: Adam Jackson <ajax at redhat.com>
> Date: Mon, 27 Feb 2012 11:35:20 -0500
> 
> Well, almost all of them.  zlib doesn't support "e" in the mode string
> in gzopen() though it will silently accept and ignore it, and Solaris appears
> not to support "e" in the mode string at all.

Neither does OpenBSD.  And POSIX doesn't seem to mention it either.
So this smells like a Linux-specific extension.  Or perhaps more
accurately, a glibc-specific extension.  So you should change the
#ifdefs around I think.  Or perhaps go the protable route using
fileno(3) and fcntl(2).  I don't think atomicity is a real requirement
here.

> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  src/common_device_name.c |   22 ++++++++++++++++++++--
>  src/common_vgaarb.c      |    2 +-
>  src/freebsd_pci.c        |    8 ++++----
>  src/linux_sysfs.c        |   26 +++++++++++++-------------
>  src/netbsd_pci.c         |    4 ++--
>  src/openbsd_pci.c        |    2 +-
>  src/pciaccess_private.h  |   19 +++++++++++++++++++
>  src/solx_devfs.c         |    6 +++---
>  src/x86_pci.c            |    4 ++--
>  9 files changed, 65 insertions(+), 28 deletions(-)


More information about the xorg-devel mailing list