Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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?
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 perusing the Monastery: (11)
As of 2014-12-18 10:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (49 votes), past polls