Passing open file descriptor to the exec'ed process

Bruce M Ong DeadHead at cup.portal.com
Thu Oct 18 06:46:09 AEST 1990


Hi -
	I have a question w/ regard to passing open file descriptors
from a parent to a child that's spawned with 'exec' not 'fork'. Basically,
how to do it right?

	I have a parent process that makes a socket connection with a remote
server. And depending on a server reply message type, I want the parent
process to exec another program (the parent process will go away, with
the new program replacing it). However, i dont want to close the connection
and open the connection again from the new program - I want the new program
to inherite the open socket descriptor and continue to talk to the server,
without the server knowing that the client has gone through a metamorphosis.

	Any hints or where can I find some source example, (does the BSD
inetd do something like this?) would be much appreciated.

	thanks -

	bruce
	deadhead at cup.portal.com
	



More information about the Comp.unix.programmer mailing list