koh_process.c

202 B · raw

1#include "koh_process.h"23#include <errno.h>4#include <signal.h>56int koh_pid_alive(int pid) {7	if (pid <= 0) {8		return 0;9	}10	if (kill(pid, 0) == 0) {11		return 1;12	}13	return errno == EPERM ? 1 : 0;14}