System call fork() and execv function
问题 I'm trying to run two executables consecutively using this c code: #include <stdio.h> #include <unistd.h> int main (int argc, char *argv[]) { fork(); execv("./prcs1", &argv[1]); // GIVE ADDRESS OF 2nd element as starting point to skip source.txt fork(); execv("./prcs2", argv); printf("EXECV Failed\n"); } The program exits after the first execv() call despite the fork, it never gets to the second execv(). I've tried calling wait() after the first fork but I'm not sure that's what it's missing.