How do I interrupt a process started from C++ with the popen
call — how do I send it a SIGINT? Here is the popen
call:
FILE* pipe = popen("vlc", "r");
I would like to close vlc
when I want with an interrupt signal.
How do I interrupt a process started from C++ with the popen
call — how do I send it a SIGINT? Here is the popen
call:
FILE* pipe = popen("vlc", "r");
I would like to close vlc
when I want with an interrupt signal.
Why not implement your own signal handler and do a pclose on the opened pipe? That should send sigpipe to VLC. popen is really a bad way to fork the process. you get no PID out of it. There are a lot of implementations floating around that do the same thing using fork and that return also a PID. Ask back if you can't find any.