Hey I have to write a small process launcher for uni.
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main(int argc, char* argv[]){
pid_t pid;
if((pid = fork()) < 0){
return 0;
}
else if(pid == 0){
if(execvp(*argv, argv) < 0){
return 0;
}
}
return 0;
}
This is my program. I want to call it like ./process-launcher firefox --browser to start a new firefox process.
I think when I start the programm like this there should be a process of firefox in my system monitoring but it isn't
How do I get this?
Compiling with:
clang -o process-launcher process-launcher.c