Reputation: 3027
I'm searching a way to get the current PID of a process having its path.
For example I know that the path firefox
is /usr/bin/firefox
, I have launched it and I would like to find its PID in C++.
How could I do that ?
Upvotes: 0
Views: 819
Reputation: 13065
Take a look at the 'pgrep' program. Source is here, I think: http://procps.sourceforge.net/
Upvotes: 1