Answers for "c check if pid is running"

C
0

check if pid exists c

#include <sys/stat.h>
[...]
struct stat sts;
if (stat("/proc/<pid>", &sts) == -1 && errno == ENOENT) {
  // process doesn't exist
}
Posted by: Guest on October-04-2020

Code answers related to "c check if pid is running"

Code answers related to "C"

Browse Popular Code Answers by Language