Lines Matching defs:pid
52 ** Extensions for UUCP style locks (i.e. pid is an int in the file,
123 xtmpfile(const char *file, pid_t pid, int uucpstyle)
138 snprintf(buf, sizeof(buf), "%jd\n", (intmax_t)pid);
162 (write(fd, &pid, sizeof(pid)) != sizeof(pid)) :
165 warn("write(%s,%jd)", tempname, (intmax_t)pid);
181 p_exists(pid_t pid)
183 dprintf("%s: process %jd is ", Pname, (intmax_t)pid);
184 if (pid <= 0) {
188 if (kill(pid, 0) == -1) {
191 dprintf("dead %jd\n", (intmax_t)pid);
192 return FALSE; /* pid does not exist */
195 return TRUE; /* pid exists */
202 return TRUE; /* pid exists */
225 pid_t pid;
242 ((len = read(fd, &pid, sizeof(pid))) != sizeof(pid)) :
251 return p_exists(uucpstyle ? pid : atoi(buf));
255 mklock(const char *file, pid_t pid, int uucpstyle)
262 (intmax_t)pid);
263 if ((tmp = xtmpfile(file, pid, uucpstyle)) == NULL)
369 pid_t pid = 0;
386 pid = atoi(&av[x][2]);
391 pid = atoi(av[x]);
411 if (file == NULL || (!only_check && pid <= 0)) {
419 exit(mklock(file, pid, uucpstyle) ? LOCK_SET : LOCK_FAIL);