Lines Matching defs:pid
194 pid_t pid;
256 if ((pid = fork()) < 0)
258 else if (pid != 0)
261 pid = getpid();
263 if (write_pidfile(pid_fd, pid) == -1) /* logs errors on failure */
1005 pid_t pid, child;
1074 pid = 0;
1075 while (pid != child)
1076 pid = wait(&status);
1280 * Create a file which will contain our pid. Pmconfig will check this file
1281 * to see if we are running and can use the pid to signal us. Returns the
1285 * of an obsolete pid file caused by an earlier abort.
1291 const char *e1 = "%s: Cannot open pid file for read: ";
1292 const char *e2 = "%s: Cannot unlink obsolete pid file: ";
1294 " process is defunct (pid %d). \n";
1295 const char *e4 = "%s: Cannot create pid file: ";
1301 pid_t pid;
1309 /* Read the pid */
1310 pid = (pid_t)-1;
1311 (void) fscanf(fp, "%ld", &pid);
1313 if (pid == -1) {
1322 /* Is pid for a running process */
1323 if (kill(pid, 0) == -1) {
1333 (void) fprintf(stderr, e3, me, pid);
1349 * Write a pid to the pid file. Report errors to syslog.
1353 write_pidfile(int fd, pid_t pid)
1358 len = sprintf(scratch, "%ld\n", pid);
1360 logerror("Cannot write pid file: %s", strerror(errno));