我们先看下面的程序:
#include <stdio.h>int main(){int child;char *args[] = {"/bin/echo", "Hello", "World!", NULL};if(!(child = fork())){/* child */execve("/bin/echo", args, NULL});printf("I am back, something is wrong!\n");}else{/* father */wait4(child, NULL, 0, NULL);}}
,值不值得,真是不足为外人道,自己心里有数就行。