Talkanian
Talkanian

Reputation: 29

pkill not working in system() command

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...

Upvotes: 0

Views: 1080

Answers (0)

Related Questions