Answers for "how to check if a pid exists in c"

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 "how to check if a pid exists in c"

Code answers related to "C"

Browse Popular Code Answers by Language