All of lore.kernel.org
 help / color / mirror / Atom feed
* FD_CLOEXEC doesn't take affect through a system("foo") call??
@ 2005-01-31  6:39 Ben Greear
  0 siblings, 0 replies; only message in thread
From: Ben Greear @ 2005-01-31  6:39 UTC (permalink / raw)
  To: 'netdev@oss.sgi.com'

I found a funny thing in the 2.6.9 kernel.  Not sure if it only
happens here, or if it's even a bug, but it was unexpected to me at least...

I have a server that opens a listening socket, and sets the FD_CLOEXEC
bit, among other things.  Sometime later, it creates a pppd.bash file
that just starts pppd in the background. From my main process, I
execute the pppd.bash script with the system() command.

My expectation is that pppd would be spawned and that it would NOT
be also listening on the socket that my main server is using.  However,
that is not the case:  The pppd process has that socket and the rest of
the sockets & file-descriptos from the main process open.

I can work around this by explicitly forking, closing all FDs > 2, and
then running the system call, but is what I am seeing expected behaviour?

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-01-31  6:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-31  6:39 FD_CLOEXEC doesn't take affect through a system("foo") call?? Ben Greear

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.