Home
last modified time | relevance | path

Searched hist:e9dec7758d3372e48746d32ba8c485cf89d83802 (Results 1 – 2 of 2) sorted by relevance

/freebsd/lib/libc/gen/
H A Dpopen.3diff e9dec7758d3372e48746d32ba8c485cf89d83802 Mon May 20 19:31:18 CEST 2013 Jilles Tjoelker <jilles@FreeBSD.org> popen(): Add 'e' mode character to set close-on-exec on the new fd.

If 'e' is used, the kernel must support the recently added pipe2() system
call.

The use of pipe2() with O_CLOEXEC also fixes race conditions between
concurrent popen() calls from different threads, even if the close-on-exec
flag on the fd of the returned FILE is later cleared (because popen() closes
all file descriptors from earlier popen() calls in the child process).
Therefore, this approach should be used in all cases when pipe2() can be
assumed present.

The old version of popen() rejects "re" and "we" but treats "r+e" like "r+".
H A Dpopen.cdiff e9dec7758d3372e48746d32ba8c485cf89d83802 Mon May 20 19:31:18 CEST 2013 Jilles Tjoelker <jilles@FreeBSD.org> popen(): Add 'e' mode character to set close-on-exec on the new fd.

If 'e' is used, the kernel must support the recently added pipe2() system
call.

The use of pipe2() with O_CLOEXEC also fixes race conditions between
concurrent popen() calls from different threads, even if the close-on-exec
flag on the fd of the returned FILE is later cleared (because popen() closes
all file descriptors from earlier popen() calls in the child process).
Therefore, this approach should be used in all cases when pipe2() can be
assumed present.

The old version of popen() rejects "re" and "we" but treats "r+e" like "r+".