Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

exec sometimes changes pid

by doom (Deacon)
on Aug 02, 2009 at 21:54 UTC ( [id://785284]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use warnings;
    use strict;
    ...
      print "child believes it is: $$\n";
      exec( $cmd ) # replaces child with a new perl: pid shouldn't change,
    + right?
    }
    
  2. or download this
       parent: pre-fork id 27516
       child believes it is: 27517
    ...
       parent: still here, with id 27516
       parent: sees processes...
       27516 pts/1    R+     0:00 /usr/bin/perl /home/doom/bin/testes-fork
    +itude
    
  3. or download this
       parent: pre-fork id 7253
       child believes it is: 7254
    ...
       parent: sees processes...
       7253 pts/3    S+     0:00 /usr/bin/perl /home/doom/bin/testes-forki
    +tude
       7254 pts/3    Z+     0:00 [perl] <defunct>
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://785284]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-03-29 11:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found