[vlc-devel] [PATCH] Don't assume O_CLOEXEC is defined

Rémi Denis-Courmont remi at remlab.net
Wed Jan 4 22:33:39 CET 2012

Le mercredi 4 janvier 2012 23:18:57 Rafaël Carré, vous avez écrit :
> > I stole the code from (your?) posix/filesystem.c
> So this is Linux/glibc only

That is not true:

Besides, where something originates from is irrelevant. uselocale() is a MacOS 
invention and openat() comes from Solaris. We still use them because they are 

> (Drepper's invention)

Possibly so. The guy does have some clue about POSIX.

> Perhaps it could go in vlc_fs.h as
> #ifndef O_CLOEXEC
> # define O_CLOEXEC 0
> #endif
> >> Besides, O_CLOEXEC is older than Linux DVBv5 which the plugin requires,
> >> so it seems rather pointless.
> Do we require "a certain version of glibc which has O_CLOEXEC" ?

Linux support for close-on-exec is in the kernel, not libc. And that is 
irrelevant. What is relevant is your patch brings back a well-known annoying 
old bug, leaking of device nodes through child processes.

Rémi Denis-Courmont

More information about the vlc-devel mailing list