home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cse.unsw.edu.au
/
2014.06.ftp.cse.unsw.edu.au.tar
/
ftp.cse.unsw.edu.au
/
pub
/
doc
/
languages
/
perl
/
nutshell
/
ch5
/
forkdaemon
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1992-10-18
|
296 b
|
16 lines
unless (fork) { # this is the child
unless (fork) { # this is the child's child
sleep 1 until getppid == 1;
_L_O_N_G_O_P_E_R_A_T_I_O_N;
exit 0;
}
# first child exits quickly
exit 0;
}
wait; # parent reaps first child quickly
# or...
fork && exit;
setpgrp(0,$$);