子进程PID:506,父进程PID:505 total 36 -rwxrwxrwx 1 liu liu 8608 Oct 19 15:37 a.out -rwxrwxrwx 1 liu liu 628 Oct 19 15:37 fork.c -rwxrwxrwx 1 liu liu 8608 Oct 19 14:20 forkt -rwxrwxrwx 1 liu liu 187 Oct 19 13:16 new.c -rwxrwxrwx 1 liu liu 205 Oct 19 13:32 new2.c -rwxrwxrwx 1 liu liu 130 Oct 19 12:44 pid.c -rwxrwxrwx 1 liu liu 140 Oct 19 13:25 system.c -rwxrwxrwx 1 liu liu 8616 Oct 19 15:22 wait -rwxrwxrwx 1 liu liu 483 Oct 19 14:37 wait_forkpid.c -rwxrwxrwx 1 liu liu 571 Oct 19 15:25 waitpid.c 返回值:506,子进程PID:505,父进程PID:4 PING baidu.com (123.125.115.110) 56(84) bytes of data. 64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=1 ttl=48 time=31.0 ms 64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=2 ttl=48 time=31.4 ms 64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=3 ttl=48 time=31.0 ms 64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=4 ttl=48 time=33.5 ms 64 bytes from 123.125.115.110 (123.125.115.110): icmp_seq=5 ttl=48 time=32.0 ms ^C --- baidu.com ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4004ms rtt min/avg/max/mdev = 31.031/31.829/33.562/0.942 ms