Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2017-08-23 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (350 votes). Check out past polls.

    Notices?