MFC r243731,r255303: libc: Allow setting close-on-exec in fopen/freopen/
fdopen.
This commit adds a new mode option 'e'.
For freopen() with a non-NULL path argument and fopen(), the close-on-exec
flag is set iff the 'e' mode option is specified. For freopen() with a NULL
path argument and fdopen(), the close-on-exec flag is turned on if the 'e'
mode option is specified and remains unchanged otherwise.
Although the same behaviour for fopen() can be obtained by open(O_CLOEXEC)
and fdopen(), this needlessly complicates the calling code.
PR: kern/169320
git-svn-id: svn://svn.freebsd.org/base/stable/9@257229
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f