Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2014-10-21 18:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (106 votes), past polls