25     static pid_t last_asked_pid = 0;  
    33     if ((rc < 0) && (errno == ESRCH)) {
    43         if (last_asked_pid != 
pid) {
    44             crm_info(
"Cannot examine PID %lld: %s",
    53         bool checked_through_kill = (rc == 0);
    54         char exe_path[PATH_MAX], myexe_path[PATH_MAX];
    60                 if ((kill(
pid, 0) < 0) && (errno == ESRCH)) {
    64             if (last_asked_pid != 
pid) {
    66                     crm_info(
"Could not get executable for PID %lld: %s "    70                     crm_err(
"Could not get executable for PID %lld: %s "    78                 return checked_through_kill? 
pcmk_rc_ok : EACCES;
    88             rc = snprintf(myexe_path, 
sizeof(myexe_path), 
"%s", 
daemon);
    91         if (rc > 0 && rc < 
sizeof(myexe_path) && !strcmp(exe_path, myexe_path)) {
   116     long long pid_read = 0;
   119     CRM_CHECK((filename != NULL) && (
pid != NULL), 
return EINVAL);
   121     fd = open(filename, O_RDONLY);
   126     if ((fstat(fd, &sbuf) >= 0) && (sbuf.st_size < 
LOCKSTRLEN)) {
   132     if (read(fd, buf, 
sizeof(buf)) < 1) {
   137     if (sscanf(buf, 
"%lld", &pid_read) > 0) {
   142             *
pid = (pid_t) pid_read;
   143             crm_trace(
"Read pid %lld from %s", pid_read, filename);
   166                       const char *expected_name, pid_t *
pid)
   168     pid_t pidfile_pid = 0;
   180     } 
else if ((expected_pid > 0) && (pidfile_pid == expected_pid)) {
   189     } 
else if ((expected_pid > 0) && (pidfile_pid != expected_pid)) {
   209     pid_t mypid = getpid();
   220     fd = open(filename, O_CREAT | O_WRONLY | O_EXCL, 0644);
   225     snprintf(buf, 
sizeof(buf), 
"%*lld\n", 
LOCKSTRLEN - 1, (
long long) mypid);
   230         crm_perror(LOG_ERR, 
"Incomplete write to %s", filename);
 #define CRM_CHECK(expr, failure_action)
 
int pcmk__read_pidfile(const char *filename, pid_t *pid)
 
int pcmk__pid_active(pid_t pid, const char *daemon)
 
const char * pcmk_rc_str(int rc)
Get a user-friendly description of a return code. 
 
bool pcmk__procfs_has_pids(void)
 
int daemon(int nochdir, int noclose)
 
#define crm_trace(fmt, args...)
 
int pcmk__pidfile_matches(const char *filename, pid_t expected_pid, const char *expected_name, pid_t *pid)
 
#define crm_perror(level, fmt, args...)
Send a system error message to both the log and stderr. 
 
#define crm_err(fmt, args...)
 
int pcmk__procfs_pid2path(pid_t pid, char path[], size_t path_size)
 
int pcmk__lock_pidfile(const char *filename, const char *name)
 
#define crm_info(fmt, args...)