int pid = fork(); if (pid == -1) { // 错误 perror("fork"); goto fail; } else if (pid == 0) { // 子进程 execve(...); perror("execve"); exit(EXIT_FAILURE); } else { // 父进程 ... int status; waitpid(pid, &status, 0); // testkit.c 中有 }