Lines Matching refs:pid
54 uint32_t pid; in read_pid() local
71 if (pa_atou(t, &pid) < 0) { in read_pid()
77 return (pid_t) pid; in read_pid()
136 static int proc_name_ours(pid_t pid, const char *procname) { in proc_name_ours() argument
141 pa_snprintf(bn, sizeof(bn), "/proc/%lu/stat", (unsigned long) pid); in proc_name_ours()
162 expected = pa_sprintf_malloc("%lu (%s)", (unsigned long) pid, procname); in proc_name_ours()
169 expected = pa_sprintf_malloc("%lu (lt-%s)", (unsigned long) pid, procname); in proc_name_ours()
189 pid_t pid; local
203 if ((pid = read_pid(fn, fd)) == (pid_t) -1)
205 else if (pid > 0) {
209 if ((process = OpenProcess(PROCESS_QUERY_INFORMATION, false, pid)) != NULL) {
212 if (kill(pid, 0) >= 0 || errno != ESRCH) {
216 if ((ours = proc_name_ours(pid, procname)) < 0) {
218 … "Assuming it is and the daemon is already running.", (unsigned long) pid);
268 pid_t pid; local
278 if ((pid = read_pid(fn, fd)) == (pid_t) -1)
281 if (pid != getpid()) {
324 int pa_pid_file_check_running(pid_t *pid, const char *procname) { argument
325 return pa_pid_file_kill(0, pid, procname);
333 int pa_pid_file_kill(int sig, pid_t *pid, const char *procname) { argument
342 if (!pid)
343 pid = &_pid;
356 if ((*pid = read_pid(fn, fd)) == (pid_t) -1)
362 if ((ours = proc_name_ours(*pid, procname)) < 0)
371 ret = kill(*pid, sig);
394 int pa_pid_file_kill(int sig, pid_t *pid, const char *exe_name) { argument