Answers for "check if pid exists 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 "C"

Browse Popular Code Answers by Language