Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: How to close all open file descriptors after a fork?

by nneul (Novice)
on Jul 19, 2005 at 13:59 UTC ( #476096=note: print w/ replies, xml ) Need Help??


in reply to Re: How to close all open file descriptors after a fork?
in thread How to close all open file descriptors after a fork?

The problem is the "unknown context". This is in a subroutine that needs to spawn a background task, called from code that is not under my control. Therefore, I don't know what FDs/FHs are open.


Comment on Re^2: How to close all open file descriptors after a fork?
Replies are listed 'Best First'.
Re^3: How to close all open file descriptors after a fork?
by blazar (Canon) on Jul 19, 2005 at 14:06 UTC
    Well, in that case you may want to choose a way, to "spawn a background task" that will give you the pid of that task, and hopefully if you're under an OS that will let you access the relevant info for that process, you could check that.

    For example under Linux you will be able, and may want to examine "/proc/$pid/fd/".

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://476096]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2015-07-28 10:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls