Lines Matching full:pid

16 int csops(pid_t pid, unsigned int ops, void *useraddr, size_t usersize);
19 the pid of that matched process.
66 printf(" defaulting to the highest-pid one, %d\n", highest_pid); in get_pid_for_process_name()
71 /* Given a pid, get the full executable name (including directory
77 const char *get_process_name_for_pid(pid_t pid) { in get_process_name_for_pid() argument
79 if (proc_pidpath(pid, tmp_name, sizeof(tmp_name)) == 0) { in get_process_name_for_pid()
80 printf("Could not find process with pid of %d\n", (int)pid); in get_process_name_for_pid()
89 /* Get a struct kinfo_proc structure for a given pid.
96 struct kinfo_proc *get_kinfo_proc_for_pid(pid_t pid, const char *process_name) { in get_kinfo_proc_for_pid() argument
99 int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid}; in get_kinfo_proc_for_pid()
103 printf("Could not get kinfo_proc for pid %d\n", (int)pid); in get_kinfo_proc_for_pid()
252 int get_proc_threadinfo(pid_t pid, uint64_t thread_handle, in get_proc_threadinfo() argument
255 int ret = proc_pidinfo(pid, PROC_PIDTHREADINFO, thread_handle, pth, in get_proc_threadinfo()
266 pid_t pid = 0; in main() local
275 printf("Usage: tdump [-l] [-v] [-r] pid/procname\n"); in main()
294 printf("Usage: tdump [-l] [-v] pid/procname\n"); in main()
307 pid = get_pid_for_process_name(procname); in main()
310 pid = (pid_t)strtol(argv[argc - 1], NULL, 10); in main()
311 if (pid == 0 && errno == EINVAL) { in main()
312 printf("Usage: tdump [-l] [-v] pid/procname\n"); in main()
317 const char *process_name = get_process_name_for_pid(pid); in main()
319 // At this point "pid" is the process id and "process_name" is the process in main()
325 struct kinfo_proc *kinfo = get_kinfo_proc_for_pid(pid, process_name); in main()
327 printf("pid %d (%s) is currently ", pid, process_name); in main()
354 if (csops(pid, CS_OPS_STATUS, &csops_flags, sizeof(csops_flags)) != -1 && in main()
356 printf("pid %d (%s) is restricted so nothing can attach to it.\n", pid, in main()
360 kr = task_for_pid(mach_task_self(), pid, &task); in main()
393 printf("pid %d has %d threads\n", pid, thread_count); in main()
439 get_proc_threadinfo(pid, identifier_info.thread_handle, &pth); in main()