another process (not calling or child process) ?
I know for sure there is, but no idea how in C or C++. Utilities like top are able to do this though by parsing the proc directory.
opendir /proc readdir in loop append comm or exe compare content of comm or readlink of exe with name or full name of your program if match so pid is the object name in dirstream
ProcessHandle
you can get process id by name in Linux
Обсуждают сегодня