Check if process exists given its pid

后端 未结 6 1272
孤独总比滥情好
孤独总比滥情好 2020-12-01 02:06

Given the pid of a Linux process, I want to check, from a C program, if the process is still running.

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 02:36

    As an addendum to the /proc filesystem method, you can check the /proc//cmdline (assuming it was started from the command line) to see if it is the process you want.

提交回复
热议问题