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

Rafaël Carré rafael.carre at gmail.com
Wed Jan 4 22:43:19 CET 2012

Le 2012-01-04 16:33, Rémi Denis-Courmont a écrit :
> 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:
> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html

OK I only have the previous edition on disk

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

Speaking of which, dirfd() is a BSD function.
We don't use it on BSD because (some of?) those systems declare it as a
macro and AC_REPLACE_FUNCS doesn't catch it.

>> (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.

The flag is actually used where possible .. so it's not "bringing back"
a bug, but let VLC build (and leak device nodes through child processes)
on systems without O_CLOEXEC.

Also you must have understood by now that this is for FreeBSD..

More information about the vlc-devel mailing list