jilles 04619555a4 libc: Allow setting close-on-exec in fopen/freopen/fdopen.
This commit adds a new mode option 'e' that must follow any 'b', '+' and/or
'x' options. C11 is clear about the 'x' needing to follow 'b' and/or '+' and
that is what we implement; therefore, require a strict position for 'e' as
well.

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.

Apart from the ordering requirement, the new option matches glibc.

PR:		kern/169320
2012-11-30 23:51:33 +00:00
..
2012-09-06 20:59:49 +00:00
2012-08-15 03:09:00 +00:00
2012-05-12 07:52:45 +00:00
2012-09-05 21:41:05 +00:00
2012-03-28 19:20:28 +00:00
2012-03-06 03:30:09 +00:00
2012-05-13 14:16:04 +00:00
2011-07-10 06:57:00 +00:00