| /xnu-11215/libsyscall/wrappers/libproc/ |
| H A D | libproc.c | 299 int pid = audittoken->val[5]; in proc_pidpath_audittoken() local 327 pid_t pid = getpid(); in proc_current_thread_schedinfo() local 431 proc_terminate(pid_t pid, int *sig) in proc_terminate() argument 592 proc_resume_cpumon(pid_t pid) in proc_resume_cpumon() argument 598 NULL, pid, 0); in proc_resume_cpumon() 602 proc_disable_cpumon(pid_t pid) in proc_disable_cpumon() argument 662 (void)proc_disable_cpumon(pid); in proc_set_cpumon_params_fatal() 714 proc_disable_wakemon(pid_t pid) in proc_disable_wakemon() argument 761 proc_clear_cpulimits(pid_t pid) in proc_clear_cpulimits() argument 864 pid_t passpid = pid; in proc_pidbind() [all …]
|
| H A D | libproc_internal.h | 40 int proc_clear_cpulimits(pid_t pid) __OSX_AVAILABLE_STARTING(__MAC_10_12_2, __IPHONE_5_0); 61 int proc_setappstate(int pid, int appstate); 62 int proc_appstate(int pid, int * appstatep); 71 int proc_pidbind(int pid, uint64_t threadid, int bind); 88 int proc_can_use_foreground_hw(int pid, uint32_t *reason); 93 int proc_clear_vmpressure(pid_t pid); 114 int proc_disable_apptype(pid_t pid, int apptype); 115 int proc_enable_apptype(pid_t pid, int apptype); 145 int proc_resume_cpumon(pid_t pid) __OSX_AVAILABLE_STARTING(__MAC_10_12, __IPHONE_10_0); 146 int proc_disable_cpumon(pid_t pid) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); [all …]
|
| H A D | proc_listpidspath.c | 483 status = check_process_vnodes(info, pid); in check_process_phase1() 490 status = check_process_fds(info, pid); in check_process_phase1() 521 status = check_process_text(info, pid); in check_process_phase2() 617 int pid; in proc_listpidspath() local 620 pid = info->pids[i]; in proc_listpidspath() 621 if (pid == 0) { in proc_listpidspath() 631 *buf_next++ = pid; in proc_listpidspath() 648 int pid; in proc_listpidspath() local 651 pid = info->pids[i]; in proc_listpidspath() 652 if (pid == 0) { in proc_listpidspath() [all …]
|
| H A D | libproc.h | 96 int proc_pidinfo(int pid, int flavor, uint64_t arg, void *buffer, int buffersize) __OSX_AVAILABLE_S… 97 int proc_pidfdinfo(int pid, int fd, int flavor, void * buffer, int buffersize) __OSX_AVAILABLE_STAR… 99 int proc_name(int pid, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __I… 102 int proc_pidpath(int pid, void * buffer, uint32_t buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5,… 111 int proc_pid_rusage(int pid, int flavor, rusage_info_t *buffer) __OSX_AVAILABLE_STARTING(__MAC_10_9… 125 int proc_track_dirty(pid_t pid, uint32_t flags); 126 int proc_set_dirty(pid_t pid, bool dirty); 127 int proc_get_dirty(pid_t pid, uint32_t *flags); 128 int proc_clear_dirty(pid_t pid, uint32_t flags); 130 int proc_terminate(pid_t pid, int *sig); [all …]
|
| /xnu-11215/tests/ |
| H A D | proc_pidpath_audittoken.c | 13 audit_token_for_pid(pid_t pid, audit_token_t *token) in audit_token_for_pid() argument 19 err = task_for_pid(mach_task_self(), pid, &task); in audit_token_for_pid() 37 idversion_for_pid(pid_t pid) in idversion_for_pid() argument 62 for (pid_t pid = 1; ((pid < 1000) && (count <= 25)); pid++) { in show_pidpaths() local 63 int ret = proc_pidpath(pid, buffer, sizeof(buffer)); in show_pidpaths() 68 T_ASSERT_FAIL("proc_pidpath(%d) failed unexpectedly with errno %d", pid, errno); in show_pidpaths() 76 if (!audit_token_for_pid(pid, &token)) { in show_pidpaths() 77 T_ASSERT_FAIL("audit_token_for_pid(%d) failed", pid); in show_pidpaths() 81 token.val[5] = (unsigned int)pid; in show_pidpaths() 82 token.val[7] = (unsigned int)idversion_for_pid(pid); in show_pidpaths() [all …]
|
| H A D | task_policy.c | 85 pid_t pid = 0; variable 115 pid_t pid = 0; variable 145 pid_t pid = 0; variable 228 pid_t pid = 0; variable 258 pid_t pid = 0; variable 288 pid_t pid = 0; variable 375 pid_t pid = 0; variable 405 pid_t pid = 0; variable 435 pid_t pid = 0; variable 518 pid_t pid = 0; variable [all …]
|
| H A D | codesigntests.c | 18 get_blob(pid_t pid, int op) in get_blob() argument 25 rcent = csops(pid, op, header, cnt); in get_blob() 31 rcent = csops(pid, op, header, sizeof(header)); in get_blob() 48 rcent = csops(pid, op, buffer, bufferlen - 1); in get_blob() 51 rcent = csops(pid, op, buffer, bufferlen); in get_blob() 76 rcent = csops(pid, op, buffer, bufferlen + 1); in get_blob() 96 pid_t pid; variable 98 pid = getpid(); 107 rcent = get_blob(pid, CS_OPS_BLOB); 114 rcent = get_blob(pid, CS_OPS_IDENTITY); [all …]
|
| H A D | memorystatus_assertion_helpers.c | 23 T_LOG("Relinquish ...assertion... priority(%d) for pid[%d]", priority, pid); in set_priority() 25 T_LOG("Setting ...assertion... priority(%d) for pid[%d]", priority, pid); in set_priority() 29 T_LOG("Setting ...requested... priority(%d) for pid[%d]", priority, pid); in set_priority() 100 set_assertion_priority(pid_t pid, int32_t priority, uint64_t user_data) in set_assertion_priority() argument 102 return set_priority(pid, priority, user_data, TRUE); in set_assertion_priority() 106 relinquish_assertion_priority(pid_t pid, uint64_t user_data) in relinquish_assertion_priority() argument 108 return set_assertion_priority(pid, JETSAM_PRIORITY_IDLE, user_data); in relinquish_assertion_priority() 113 pid_t pid, in set_memlimits() argument 137 T_LOG("Setting pid[%d] limits active [%d %s] inactive [%d %s]", pid, in set_memlimits() 164 if (entry.pid != pid) { in get_priority_props() [all …]
|
| H A D | sigcont_return.c | 13 pid_t pid; variable 15 pid = fork(); 16 T_QUIET; T_ASSERT_NE_INT(pid, -1, "fork() failed!"); 18 if (pid == 0) { 23 kill(pid, SIGSTOP); 24 kill(pid, SIGCONT); 27 …IET; T_ASSERT_POSIX_SUCCESS(waitid(P_PID, pid, &siginfo, WCONTINUED), "Calling waitid() failed for… 30 kill(pid, SIGKILL);
|
| H A D | sigchld_return.c | 32 int pid; variable 41 pid = fork(); 42 T_QUIET; T_ASSERT_NE_INT(pid, -1, "fork() failed!"); 44 if (pid == 0) { 60 pid_t pid = fork(); variable 62 if (pid == 0) { 69 ret = waitid(P_PID, (id_t) pid, &siginfo, WEXITED); 85 pid_t pid = fork(); variable 87 if (pid == 0) { 93 ret = waitid(P_PID, (id_t) pid, &siginfo, WEXITED); [all …]
|
| H A D | lockf_basic.c | 42 fl->l_pid = pid; in ofd_get() 54 fl->l_pid = pid; in posix_get() 251 pid_t pid = getpid(); variable 303 130, 45, 0, pid); 313 125, 50, 0, pid); 323 125, 50, 0, pid); 333 100, 100, 0, pid); 343 100, 125, 0, pid); 353 75, 150, 0, pid); 363 50, 175, 0, pid); [all …]
|
| H A D | test_note_exec.c | 23 static int pid; variable 62 csret = csops(pid, CS_OPS_STATUS, &status, sizeof(status)); in thread_wait_exec() 70 T_QUIET; T_ASSERT_EQ((int)kev.udata, pid, "EVFILT_PROC event received for child pid"); in thread_wait_exec() 92 pid = fork(); in run_test() 94 if (pid == 0) { in run_test() 105 T_QUIET; T_LOG("Setting up NOTE_EXEC Handler for child pid %d", pid); in run_test() 109 EV_SET64(&kev, pid, EVFILT_PROC, EV_ADD | EV_ENABLE, in run_test() 110 NOTE_EXEC, 0, pid, 0, 0); in run_test() 122 pid = waitpid(pid, NULL, 0); in run_test() 123 T_QUIET; T_ASSERT_POSIX_SUCCESS(pid, "waitpid()"); in run_test()
|
| H A D | prioritize_process_launch.c | 317 pid_t pid; in workloop_cb_test_intransit() local 354 pid_t pid; in workloop_cb_test_knote_kill() local 388 static pid_t pid = 0; in workloop_cb_test_sync_bootstrap() local 477 pid_t pid; variable 500 pid_t pid; variable 523 pid_t pid; variable 546 pid_t pid; variable 601 pid_t pid; variable 632 pid_t pid; variable 659 pid_t pid; variable [all …]
|
| H A D | posix_spawn_alt_rosetta.c | 19 int ret, pid; variable 45 ret = posix_spawn(&pid, path, NULL, &spawnattr, NULL, NULL); 47 ret = waitpid(pid, &wait_ret, 0); 48 T_QUIET; T_ASSERT_EQ(ret, pid, "child pid"); 57 ret = posix_spawn(&pid, path, NULL, &spawnattr, NULL, NULL); 59 ret = waitpid(pid, &wait_ret, 0); 60 T_QUIET; T_ASSERT_EQ(ret, pid, "child pid"); 69 ret = posix_spawn(&pid, path, NULL, &spawnattr, NULL, NULL); 71 ret = waitpid(pid, &wait_ret, 0); 72 T_QUIET; T_ASSERT_EQ(ret, pid, "child pid");
|
| H A D | proc_core_name_24152432.c | 75 int pid, ret; in fork_and_wait_for_segfault() local 76 pid = fork(); in fork_and_wait_for_segfault() 77 if (pid == 0) { in fork_and_wait_for_segfault() 82 T_ASSERT_TRUE(pid != -1, "Checking fork success in parent"); in fork_and_wait_for_segfault() 86 return pid; in fork_and_wait_for_segfault() 121 snprintf(buf, BUFFLEN, format, pid); in look_for_coredump() 166 int ret, pid, dir; variable 190 pid = fork_and_wait_for_segfault(); 191 look_for_coredump(default_dump_fmt, pid, kqfd, &kev); 197 pid = fork_and_wait_for_segfault(); [all …]
|
| H A D | memorystatus_is_assertion.c | 67 proc_will_set_clean(pid_t pid) in proc_will_set_clean() argument 69 proc_set_dirty(pid, false); in proc_will_set_clean() 70 T_LOG("pid[%d] --> now clean", pid); in proc_will_set_clean() 75 proc_will_set_dirty(pid_t pid) in proc_will_set_dirty() argument 77 proc_set_dirty(pid, true); in proc_will_set_dirty() 78 T_LOG("pid[%d] --> now dirty", pid); in proc_will_set_dirty() 577 pid_t pid = getpid(); variable 594 proc_set_dirty(pid, true); 599 proc_set_dirty(pid, false); 610 proc_set_dirty(pid, true); [all …]
|
| H A D | perf_exit.c | 125 T_QUIET; T_ASSERT_LE(e->pid, PID_MAX, "pid %d is valid in start tracepoint", e->pid); 126 begin_ts[e->pid] = e->timestamp; 130 T_ASSERT_LE(e->pid, PID_MAX, "pid %d is valid in end tracepoint", e->pid); 132 if (begin_ts[e->pid] == 0) { 136 T_QUIET; T_ASSERT_LE(begin_ts[e->pid], e->timestamp, "timestamps are monotonically increasing"); 137 dt_stat_mach_time_add(s, e->timestamp - begin_ts[e->pid]); 167 pid_t pid; 168 int bret = posix_spawn(&pid, args[0], NULL, NULL, args, NULL); 169 …T_ASSERT_POSIX_ZERO(bret, "spawned process with pid %d (threads=%s mem=%s)", pid, nthreads_buf, me… 171 bret = waitpid(pid, &status, 0); [all …]
|
| H A D | perf_spawn_fork.c | 19 pid_t pid; \ 23 err = posix_spawn(&pid, args[0], NULL, NULL, args, NULL); \ 28 waitpid(pid, &status, 0); \ 49 pid_t pid; \ 53 pid = fork(); \ 54 if (pid == 0) \ 56 else if (pid == -1) \ 59 waitpid(pid, &status, 0); \
|
| H A D | memorystatus_assertion_helpers.h | 30 set_priority(pid_t pid, int32_t priority, uint64_t user_data, boolean_t is_assertion_driven); 37 check_properties(pid_t pid, int32_t expected_priority, int32_t expected_limit_mb, uint64_t expected… 48 pid_t pid, 57 set_assertion_priority(pid_t pid, int32_t priority, uint64_t user_data); 64 relinquish_assertion_priority(pid_t pid, uint64_t user_data); 77 get_priority_props(pid_t pid, boolean_t verbose, int32_t *priority, int32_t *limit_mb, uint64_t *us…
|
| H A D | test_utils.c | 38 pid_t pid; in launch_background_helper() local 53 ret = dt_launch_tool(&pid, launch_tool_args, start_suspended, NULL, NULL); in launch_background_helper() 59 set_process_memorystatus_managed(pid); in launch_background_helper() 62 return pid; in launch_background_helper() 66 set_process_memorystatus_managed(pid_t pid) in set_process_memorystatus_managed() argument 68 kern_return_t ret = memorystatus_control(MEMORYSTATUS_CMD_SET_PROCESS_IS_MANAGED, pid, 1, NULL, 0); in set_process_memorystatus_managed()
|
| /xnu-11215/tests/vm/ |
| H A D | entitlement_increased_memory_limit.c | 90 pid_t pid; in spawn_child_with_memlimit() local 114 return pid; in spawn_child_with_memlimit() 125 ret = kill(pid, SIGCONT); in resume_child_and_verify_exit() 130 rc = waitpid(pid, &status, 0); in resume_child_and_verify_exit() 134 T_ASSERT_EQ(rc, pid, "waitpid"); in resume_child_and_verify_exit() 152 pid_t pid; variable 188 resume_child_and_verify_exit(pid); 202 pid_t pid; variable 239 resume_child_and_verify_exit(pid); 250 pid_t pid; variable [all …]
|
| H A D | memorystatus_sort_test.c | 162 __block pid_t pid; variable 195 place_proc_in_band(pid, kJetsamBand); 207 pid_t pid; in launch_proc_in_coalition() local 231 children_pids[num_children++] = pid; in launch_proc_in_coalition() 232 return pid; in launch_proc_in_coalition() 263 coalition->pids[i] = pid; in init_coalition() 271 coalition->expected_order[3] = pid; in init_coalition() 273 coalition->expected_order[2] = pid; in init_coalition() 275 coalition->expected_order[1] = pid; in init_coalition() 277 coalition->expected_order[0] = pid; in init_coalition() [all …]
|
| H A D | memorystatus_convert_limit_bytes.c | 40 pid_t pid = getpid(); variable 58 …ret = memorystatus_control(MEMORYSTATUS_CMD_SET_MEMLIMIT_PROPERTIES, pid, 0, &mmprops.v1, sizeof(m… 61 …ret = memorystatus_control(MEMORYSTATUS_CMD_GET_MEMLIMIT_PROPERTIES, pid, 0, &mmprops, sizeof(mmpr… 75 …ret = memorystatus_control(MEMORYSTATUS_CMD_SET_MEMLIMIT_PROPERTIES, pid, 0, &mmprops.v1, sizeof(m… 78 …ret = memorystatus_control(MEMORYSTATUS_CMD_GET_MEMLIMIT_PROPERTIES, pid, 0, &mmprops, sizeof(mmpr… 92 …ret = memorystatus_control(MEMORYSTATUS_CMD_SET_MEMLIMIT_PROPERTIES, pid, 0, &mmprops.v1, sizeof(m… 95 …ret = memorystatus_control(MEMORYSTATUS_CMD_GET_MEMLIMIT_PROPERTIES, pid, 0, &mmprops, sizeof(mmpr… 110 pid_t pid = getpid(); variable 129 …ret = memorystatus_control(MEMORYSTATUS_CMD_SET_MEMLIMIT_PROPERTIES, pid, 0, &mmprops.v1, sizeof(m… 132 …ret = memorystatus_control(MEMORYSTATUS_CMD_GET_MEMLIMIT_PROPERTIES, pid, 0, &mmprops, sizeof(mmpr…
|
| /xnu-11215/tests/ipc/ |
| H A D | ipc_thread_ports_race.c | 60 test_race(const char *how, task_t task, pid_t pid) in test_race() argument 67 T_LOG("Starting: %s (port: %#x, pid: %d)", how, task, pid); in test_race() 88 if (pid) { in test_race() 89 kill(pid, SIGKILL); in test_race() 90 waitpid(pid, NULL, 0); in test_race() 115 pid_t pid; in fork_child_test() local 119 pid = fork(); in fork_child_test() 120 if (pid == 0) { in fork_child_test() 125 if (pid < 0) { in fork_child_test() 126 T_ASSERT_POSIX_SUCCESS(pid, "fork"); in fork_child_test() [all …]
|
| /xnu-11215/bsd/kern/ |
| H A D | sys_coalition.c | 603 int error, pid; variable 616 pid = (int)value; 620 tproc = proc_find(pid); 639 int error, pid; variable 652 pid = (int)value; 656 tproc = proc_find(pid); 675 int error, pid; variable 689 pid = (int)value; 693 tproc = proc_find(pid); 749 pid = value[2]; [all …]
|