in reply to Re^2: Detecting fork events in a module?
in thread Detecting fork events in a module?

If an exec was issued the module (in memory) would be blown-away, ...

Yes, in the child, only.

But, the exec'd program would inherit the open file descriptor, which (I thought) might be why the OP want's to close it it. Hence the mench.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re^3: Detecting fork events in a module?

Replies are listed 'Best First'.
Re^4: Detecting fork events in a module?
by cdarke (Prior) on Aug 02, 2007 at 14:17 UTC
    Fair enough. I almost suggested FD_CLOEXEC myself, but figured the guy wanted to stay within his module, since kingkongrevenge says:
    When a user of the module forks, I want to close the duped socket connection and open a new one.
    It is the opening of a new one that would be rather difficult after an exec - although not impossible if the exec was to perl with a -M option, and the module opened the new handle in its BEGIN block.