From: Smelly Pooh (plop at domain redbrick.dcu.ie)
Date: Tue 18 Jul 2000 - 19:44:32 IST
In reply to Caolan McNamara's flatulent wordings,
> Funny how you get blind spots about various things, was discussing
> file descriptors and have been assuming for ages that a newly execed
> program got a completely new set of such resources. But on reading the
> sun man page I was enlightened.
>
> After a fork both parent and child have the same fds, after an exec
> the new process *still* has the same open fds (as long as fcntl with ,
> FD_CLOEXEC to close them on exec isnt set). Enter crash tolerant stuff...
Well, think about stuff like inetd, which listens on sockets and forks/execs
various daemons when it gets a connection, socket fd needs to be preserved
there. Even for something as simple as a unix pipe, foo | bar at the syscall
level it would involve a call to pipe, fork, dupping output FD to stdout on
first process, dup input FD to stdin on second process, then exec foo and exec
bar respectively
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:06:54 GMT