fork() exec , exec, - ?
exec . exec.
?
, , ( , Linux), , .
wait/waitpid, , , ls, ?
( , ), :
) ,
) ... , , , , , , .
:
:
mike@linux-4puc:~> ps
PID TTY TIME CMD
18577 pts/2 00:00:00 bash
18643 pts/2 00:00:00 ps
:
void main()
{
if(fork()){
printf("parent print");
}
else
while(1);
printf("done");
}
: " ", "". "ps", , :
mike@linux-4puc:~> ps
PID TTY TIME CMD
18577 pts/2 00:00:00 bash
18673 pts/2 00:00:02 a.out
18678 pts/2 00:00:00 ps
, a.out , while, .
source
share