Defect report from : Garrett Wollman , FreeBSD Project
(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)
@ page 777 line 9883 section exec comment {GAW-2002c}
Problem:
Defect code : 3. Clarification required
The Standard requires that all file descriptors open in the
old process remain open in the new process, unless marked
close-on-exec. However, it is not clear whether the complement
is also true; i.e., that all file descriptors closed in the old
process remain closed in the new process. The list of explicit
actions on exec() is silent on this question. Does the blanket
statement ar the end of the list (``All process attributes [...]
shall be the same in new and old process images.'') control?
This question comes up in the context of an implementation which
would automatically re-open STD{IN,OUT,ERR}_FILENO on certain
calls to exec-family functions if the calling process had closed
them. Does such an implementation conform?
Action:
I can see two possible resolutions:
a) The blanket clause controls, and the behavior described in
my example is prohibited.
b) The standard does not specify, and no conformance distinction
can be made on this basis.
If the resolution is (a), I'd like to see this stated explicitly
in the paragraph describing file descriptors: ``File descriptors
closed in the old process image, whether as a result of an explicit
call to the close() function, or as a result of the descriptor
having been marked close-on-exec, shall remain closed in the new
process.''
|