🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #1045

Passing open file descriptor to the exec'ed process

#1045
From: Bruce M Ong
Date: Wed, 17 Oct 1990 20:46
22 lines
1253 bytes
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@cup.portal.com
	
Technical Details
Message-ID: <34954@cup.portal.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!portal!cup.portal.com!DeadHead

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!portal!cup.portal.com!DeadHead
From: DeadHead@cup.portal.com (Bruce M Ong)
Newsgroups: comp.unix.programmer
Subject: Passing open file descriptor to the exec'ed process
Message-ID: <34954@cup.portal.com>
Date: 17 Oct 90 20:46:09 GMT
Distribution: na
Organization: The Portal System (TM)
Lines: 22