Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by jasonk (Parson)
on Jul 19, 2005 at 14:04 UTC ( #476099=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # from perlfaq5
    require ’sys/syscall.ph’;
    $rc = syscall(&SYS_close, $fd + 0);  # must force numeric
    die "can’t sysclose $fd: $!" unless $rc == -1;
    
  2. or download this
    #!/usr/bin/perl -w
    require 'sys/syscall.ph';
    ...
        warn "Can't sysclose $fd: $!" unless $rc == -1;
      }
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-12-18 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (42 votes), past polls