pkill not working in system() command

1k Views Asked by At

I am trying to kill a process in a C++ program (Linux). I know exactly the name of the program to kill. If I try in Bash

pkill process-name

the process is killed normally.

If in a simple C++ program I run in main

system("pkill process-name")

the process continues to run.

I have no idea why...

0

There are 0 best solutions below