From: Ben Greear <greearb@candelatech.com>
To: "'netdev@oss.sgi.com'" <netdev@oss.sgi.com>
Subject: FD_CLOEXEC doesn't take affect through a system("foo") call??
Date: Sun, 30 Jan 2005 22:39:14 -0800 [thread overview]
Message-ID: <41FDD292.4070202@candelatech.com> (raw)
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
reply other threads:[~2005-01-31 6:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41FDD292.4070202@candelatech.com \
--to=greearb@candelatech.com \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).