Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by nneul (Novice)
on Jul 19, 2005 at 13:59 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://476096]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-18 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found