/tmp>cat foo.c #include #include #include int main(int argc, char ** argv) { pid_t pid; int status; strcpy(argv[0],"Did you expect this?"); pid=fork(); if (pid<0) { perror("Can't fork"); } if (pid==0) { execlp("ps","ps","-f",NULL); exit(127); } else { waitpid(pid,&status,0); } exit(0); } /tmp>make foo cc foo.c -o foo /tmp>./foo UID PID PPID C STIME TTY TIME CMD foken 1255 1254 0 15:06 pts/0 00:00:00 -bash foken 1676 1255 0 15:21 pts/0 00:00:00 Did you expect this? foken 1677 1676 0 15:21 pts/0 00:00:00 ps -f /tmp>