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

Rémi Denis-Courmont remi at remlab.net
Thu Jan 5 08:35:46 CET 2012


On Wed, 04 Jan 2012 16:43:19 -0500, Rafaël Carré <rafael.carre at gmail.com>
wrote:
>> That is not true:
>> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html
> 
> OK I only have the previous edition on disk

Google "site:opengroup.org 2008 $keyword" is your friend.

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

POSIX requires that dirfd() is a function, not (only) a macro. This is
precisely to avoid that kind of problems.

Regardless our dirfd() function replacement should call the dirfd() macro
on systems that have one, so this should be a non-issue.

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

It actually does bring the bug back as compared to earlier VLC versions.

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

If FreeBSD provides Linux-specific header files, it is reasonable to
expect it to provide Linux APIs. So that counts as a FreeBSD bug to me.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list