who one two three four five six

utzoo!decvax!ucbvax!menlo70!sri-unix!dpk at BMD70 utzoo!decvax!ucbvax!menlo70!sri-unix!dpk at BMD70
Wed Dec 30 23:29:28 AEST 1981


From:      Doug Kingston <dpk at BMD70>
	The strange behavior that Robert Owens was talking about is
one of possible results of having stray file descriptors left open
by the invoking program.  It all depends on how that error is handled
(Try again.).  I am not saying that this has to be his problem, but
it might be.

	A while ago I send an inquiry to U-W asking if there were any problems
with changing popen to close all file descriptors except 0, 1, and 2 before
it execed the program.  One response correctly urged caution in changing
anything like POPEN, another mentioned that one might want to pass an
open file descriptor to a child.  While this is certainly possible, it
would be very bad form.  The program would have to know which file descriptor
to use or have it passed as a command line arg (UGH!).  We would consider
asking people to use pipe, fork, and exec for these cases.  (Note, we do not
have IOCTL close on exec ... But soon ...).  Any other thoughts on this matter?

						Cheers,
							Doug Kingston

PS.  What does CSH do to open file-descripters when it is execed?



More information about the Comp.unix.wizards mailing list