jilles ea9572e1d0 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+".
2013-05-20 17:31:18 +00:00
..
2008-10-22 21:56:57 +00:00
2011-11-26 16:49:25 +00:00
2012-08-11 12:07:24 +00:00
2011-10-01 12:19:48 +00:00
2011-10-01 12:19:48 +00:00
2012-02-17 12:40:27 +00:00
2012-04-26 19:21:58 +00:00
2011-05-25 14:13:53 +00:00
2012-02-11 20:28:42 +00:00
2011-12-20 22:56:13 +00:00
2013-04-11 20:15:37 +00:00
2009-03-04 01:01:26 +00:00
2009-03-04 01:01:26 +00:00
2013-05-12 05:54:58 +00:00
2012-03-26 15:18:14 +00:00
2010-01-20 11:59:46 +00:00
2011-02-04 16:40:50 +00:00
2012-06-16 06:38:11 +00:00
2013-04-23 13:03:03 +00:00
2013-04-23 13:03:03 +00:00
2012-12-12 15:27:33 +00:00
2009-05-07 13:49:48 +00:00
2010-01-24 14:44:05 +00:00
2010-01-17 15:43:14 +00:00
2007-10-30 15:26:20 +00:00