home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.os2.networking
- Path: sparky!uunet!destroyer!gatech!news.ans.net!ans.net!db3l
- From: db3l@ans.net (David Bolen)
- Subject: Re: close-on-exec/IBM tcpip dev.kit.
- Sender: news@ans.net (News Administrator)
- Message-ID: <1992Nov11.192616.20611@ans.net>
- In-Reply-To: kro@kvamdata.no's message of Tue, 10 Nov 1992 08: 24:59 GMT
- Date: Wed, 11 Nov 1992 14:31:42 GMT
- References: <1992Nov10.082459.9024@kvamdata.no>
- Organization: Advanced Network & Services, Inc. - Elmsford, NY
- Lines: 37
-
- In article <1992Nov10.082459.9024@kvamdata.no> kro@kvamdata.no (Knut Rogde) writes:
-
- >I need to be able to set a close-on-exec flag on the sockets I open, because
- >the server is supposed to start new processes (which should not inherit
- >any descriptors).
- >
- >On the UNIX-port I can use fcntl() to set this flag, but this can't be
- >done in IBM's implementation (I believe) because sockets and filedesriptors
- >do not come from the same domain.
- >
- >I would be grateful for any ideas...
-
- You may not have to do anything at all.
-
- You are correct in that sockets and file descriptors are not the same
- with IBM's TCP/IP implementation (and probably others too). Under
- IBM's TCP/IP, sockets are global descriptors, that are technically
- accessible by any process.
-
- Your child processes won't technically inherit any sockets - although
- if you supply them with one, they'll be able to use it as it is global.
- If they allocate new sockets, they will be allocated from the global
- socket space, and can't overlap with the sockets the server has open.
-
- So it isn't like an extra copy of the socket is being made for the
- child. No matter how many children your server starts, when the
- server decides to close a socket it is using, that socket will be
- completely closed.
-
- --
- -- David
- --
- /-----------------------------------------------------------------------\
- \ David Bolen \ Internet: db3l@ans.net /
- | Advanced Network & Services, Inc. \ Phone: (914) 789-5327 |
- / 100 Clearbrook Road, Elmsford, NY 10523 \ Fax: (914) 789-5310 \
- \-----------------------------------------------------------------------/
-