Lines Matching defs:pid
317 /** Read existing pid from pidfile.
318 * @param file: file name of pid file.
319 * @return: the pid from the file or -1 if none.
325 pid_t pid;
353 pid = (pid_t)strtol(pidbuf, &t, 10);
358 return pid;
361 /** write pid to file.
362 * @param pidfile: file name of pid file.
363 * @param pid: pid to write to file.
366 writepid (const char* pidfile, pid_t pid)
375 if(fprintf(f, "%lu\n", (unsigned long)pid) < 0) {
383 * check old pid file.
384 * @param pidfile: the file name of the pid file.
395 log_warn("unbound is already running as pid %u.",
493 /* check old pid file before forking */
506 /* daemonize because pid is needed by the writepid func */