in reply to sockets close-on-exec

traveler,

This doesn't really answer your question, but is more of a comment - you may want to use system rather than exec in your code.

Update: You may want to invest and purchase a copy of the Perl Cookbook. From pg. 621
Closing a Socket After Forking
- use $socket->shutdown(0);
There is more detail you may want to read up on as well.

Replies are listed 'Best First'.
Re: Re: sockets close-on-exec
by traveler (Parson) on May 30, 2001 at 18:19 UTC
    Unfortunately "system" does not allow me other flexibility I need. Update: I do have the perl cookbook. It is quite useful. I know about shutdown, too. The problems are that 1) "system" does not let me launch multiple children and track them by waiting for the DIE signals and 2) some of the sockets are not created by IO::Socket but by modules written by others.

    The query was why the close-on-exec does not seem to work. I know that I could keep track of every socket I create and close it, but I'd like to know if there is some accidental way I am foiling the close-on-exec.