Lines Matching refs:kr

50 	kern_return_t kr,  in RESULT_CHECK()  argument
56 …T_EXPECT_EQ(kr, KERN_SUCCESS, "%s should succeed with task/thread flavor %d, kr: 0x%x", f_name, fl… in RESULT_CHECK()
58 …T_EXPECT_NE(kr, KERN_SUCCESS, "%s should fail with task/thread flavor %d, kr: 0x%x", f_name, flavo… in RESULT_CHECK()
67 kern_return_t kr; in test_task_get_special_port() local
73 kr = task_get_special_port(tport, TASK_KERNEL_PORT, &special_port); in test_task_get_special_port()
74 RESULT_CHECK(kr, flavor, TASK_FLAVOR_CONTROL, "task_get_special_port(TASK_KERNEL_PORT)"); in test_task_get_special_port()
78 kr = task_get_special_port(tport, TASK_BOOTSTRAP_PORT, &special_port); in test_task_get_special_port()
79 RESULT_CHECK(kr, flavor, TASK_FLAVOR_CONTROL, "task_get_special_port(TASK_BOOTSTRAP_PORT)"); in test_task_get_special_port()
83 kr = task_get_special_port(tport, TASK_HOST_PORT, &special_port); in test_task_get_special_port()
84 RESULT_CHECK(kr, flavor, TASK_FLAVOR_CONTROL, "task_get_special_port(TASK_HOST_PORT)"); in test_task_get_special_port()
89 kr = task_get_special_port(tport, TASK_READ_PORT, &special_port); in test_task_get_special_port()
90 RESULT_CHECK(kr, flavor, TASK_FLAVOR_READ, "task_get_special_port(TASK_READ_PORT)"); in test_task_get_special_port()
91 if (KERN_SUCCESS == kr) { in test_task_get_special_port()
92 kr = task_read_for_pid(mach_task_self(), getpid(), &tfp_port); in test_task_get_special_port()
93 T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "task_read_for_pid()"); in test_task_get_special_port()
101 kr = task_get_special_port(tport, TASK_INSPECT_PORT, &special_port); in test_task_get_special_port()
102 RESULT_CHECK(kr, flavor, TASK_FLAVOR_INSPECT, "task_get_special_port(TASK_INSPECT_PORT)"); in test_task_get_special_port()
103 if (KERN_SUCCESS == kr) { in test_task_get_special_port()
104 kr = task_inspect_for_pid(mach_task_self(), getpid(), &tfp_port); in test_task_get_special_port()
105 T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "task_inspect_for_pid()"); in test_task_get_special_port()
113 kr = task_get_special_port(tport, TASK_NAME_PORT, &special_port); in test_task_get_special_port()
114 RESULT_CHECK(kr, flavor, TASK_FLAVOR_INSPECT, "task_get_special_port(TASK_NAME_PORT)"); in test_task_get_special_port()
115 if (KERN_SUCCESS == kr) { in test_task_get_special_port()
116 kr = task_name_for_pid(mach_task_self(), getpid(), &tfp_port); in test_task_get_special_port()
117 T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "task_name_for_pid()"); in test_task_get_special_port()
130 kern_return_t kr; in test_thread_get_special_port() local
135 kr = thread_get_special_port(tport, THREAD_KERNEL_PORT, &special_port); in test_thread_get_special_port()
136 RESULT_CHECK(kr, flavor, THREAD_FLAVOR_CONTROL, "thread_get_special_port(THREAD_KERNEL_PORT)"); in test_thread_get_special_port()
141 kr = thread_get_special_port(tport, THREAD_READ_PORT, &special_port); in test_thread_get_special_port()
142 RESULT_CHECK(kr, flavor, THREAD_FLAVOR_READ, "thread_get_special_port(THREAD_READ_PORT)"); in test_thread_get_special_port()
147 kr = thread_get_special_port(tport, THREAD_INSPECT_PORT, &special_port); in test_thread_get_special_port()
148 RESULT_CHECK(kr, flavor, THREAD_FLAVOR_INSPECT, "thread_get_special_port(THREAD_INSPECT_PORT)"); in test_thread_get_special_port()
158 kern_return_t kr; in test_task_threads() local
167 kr = task_threads(tport, &threadList, &threadCount); in test_task_threads()
168 RESULT_CHECK(kr, flavor, TASK_FLAVOR_INSPECT, "task_threads"); in test_task_threads()
170 if (kr) { in test_task_threads()
184 kr = mach_port_kernel_object(mach_task_self(), threadList[i], &kotype, &kaddr); in test_task_threads()
185 if (kr == KERN_INVALID_RIGHT || kr == KERN_INVALID_NAME) { in test_task_threads()
189 } else if (kr) { in test_task_threads()
190 T_FAIL("mach_port_kernel_object() failed with kr: 0x%x", kr); in test_task_threads()
219 kern_return_t kr; in test_processor_set_tasks() local
231 kr = host_processor_sets(host, &psets, &pcnt); in test_processor_set_tasks()
232 T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "host_processor_sets"); in test_processor_set_tasks()
235 kr = host_processor_set_priv(host, psets[0], &pset_priv); in test_processor_set_tasks()
236 T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "host_processor_set_priv"); in test_processor_set_tasks()
242 kr = processor_set_tasks_with_flavor(pset_priv, flavor, &taskList, &tcnt); in test_processor_set_tasks()
243 T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "processor_set_tasks_with_flavor"); in test_processor_set_tasks()
248 kr = mach_port_kernel_object(mach_task_self(), taskList[i], &kotype, &kaddr); in test_processor_set_tasks()
249 if (kr == KERN_INVALID_RIGHT || kr == KERN_INVALID_NAME) { in test_processor_set_tasks()
253 } else if (kr) { in test_processor_set_tasks()
254 T_FAIL("mach_port_kernel_object() failed with kr: 0x%x", kr); in test_processor_set_tasks()
285 kern_return_t kr; in test_task_port_mig_intrans() local
293 kr = mach_vm_write(tport, in test_task_port_mig_intrans()
297 RESULT_CHECK(kr, flavor, TASK_FLAVOR_CONTROL, "mach_vm_write"); in test_task_port_mig_intrans()
305 kr = mach_vm_remap_new(mach_task_self(), in test_task_port_mig_intrans()
318 RESULT_CHECK(kr, flavor, TASK_FLAVOR_CONTROL, "mach_vm_remap_new - VM_PROT_WRITE"); in test_task_port_mig_intrans()
319 if (KERN_SUCCESS == kr) { in test_task_port_mig_intrans()
331 kr = task_get_exception_ports(tport, EXC_MASK_ALL, in test_task_port_mig_intrans()
333 RESULT_CHECK(kr, flavor, TASK_FLAVOR_CONTROL, "task_get_exception_ports"); in test_task_port_mig_intrans()
344 kr = mach_vm_read(tport, in test_task_port_mig_intrans()
349 RESULT_CHECK(kr, flavor, TASK_FLAVOR_READ, "mach_vm_read"); in test_task_port_mig_intrans()
357 kr = mach_vm_remap_new(mach_task_self(), in test_task_port_mig_intrans()
370 RESULT_CHECK(kr, flavor, TASK_FLAVOR_READ, "mach_vm_remap_new - VM_PROT_READ"); in test_task_port_mig_intrans()
371 if (KERN_SUCCESS == kr) { in test_task_port_mig_intrans()
384 kr = mach_vm_remap_new(mach_task_self(), in test_task_port_mig_intrans()
397 RESULT_CHECK(kr, flavor, TASK_FLAVOR_READ, "mach_vm_remap_new - copy==TRUE"); in test_task_port_mig_intrans()
398 if (KERN_SUCCESS == kr) { in test_task_port_mig_intrans()
408 kr = task_get_mach_voucher(tport, 0, &voucher); in test_task_port_mig_intrans()
409 RESULT_CHECK(kr, flavor, TASK_FLAVOR_READ, "task_get_mach_voucher"); in test_task_port_mig_intrans()
418 kr = mach_port_space_info(tport, &space_info, &table, &tableCount, &tree, &treeCount); in test_task_port_mig_intrans()
419 RESULT_CHECK(kr, flavor, TASK_FLAVOR_READ, "mach_port_space_info"); in test_task_port_mig_intrans()
425 kr = task_get_exc_guard_behavior(tport, &exc_behavior); in test_task_port_mig_intrans()
426 RESULT_CHECK(kr, flavor, TASK_FLAVOR_INSPECT, "task_get_exc_guard_behavior"); in test_task_port_mig_intrans()
433 kr = task_info(tport, in test_task_port_mig_intrans()
437 RESULT_CHECK(kr, flavor, TASK_FLAVOR_NAME, "task_info"); in test_task_port_mig_intrans()
446 kern_return_t kr; in test_thread_port_mig_intrans() local
457 kr = thread_get_exception_ports(tport, EXC_MASK_ALL, in test_thread_port_mig_intrans()
459 RESULT_CHECK(kr, flavor, THREAD_FLAVOR_CONTROL, "thread_get_exception_ports"); in test_thread_port_mig_intrans()
468 kr = thread_get_mach_voucher(tport, 0, &voucher); in test_thread_port_mig_intrans()
469 RESULT_CHECK(kr, flavor, THREAD_FLAVOR_READ, "thread_get_mach_voucher"); in test_thread_port_mig_intrans()
480 kr = thread_policy_get(tport, THREAD_QOS_POLICY, in test_thread_port_mig_intrans()
482 RESULT_CHECK(kr, flavor, THREAD_FLAVOR_INSPECT, "thread_policy_get"); in test_thread_port_mig_intrans()
490 kern_return_t kr; in test_get_child_task_port() local
508 kr = task_for_pid(mach_task_self(), child_pid, &tp); in test_get_child_task_port()
509 T_QUIET; T_EXPECT_MACH_SUCCESS(kr, "task_for_pid for child %u", child_pid); in test_get_child_task_port()
511 kr = task_read_for_pid(mach_task_self(), child_pid, &tr); in test_get_child_task_port()
512 T_QUIET; T_EXPECT_MACH_SUCCESS(kr, "task_read_for_pid for child %u", child_pid); in test_get_child_task_port()
514 kr = task_inspect_for_pid(mach_task_self(), child_pid, &ti); in test_get_child_task_port()
515 T_QUIET; T_EXPECT_MACH_SUCCESS(kr, "task_inspect_for_pid for child %u", child_pid); in test_get_child_task_port()
517 kr = task_name_for_pid(mach_task_self(), child_pid, &tn); in test_get_child_task_port()
518 T_QUIET; T_EXPECT_MACH_SUCCESS(kr, "task_name_for_pid for child %u", child_pid); in test_get_child_task_port()
540 kern_return_t kr; variable
543 kr = task_for_pid(mach_task_self(), getpid(), &control_port);
544 T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "task_for_pid()");
548 kr = task_get_special_port(mach_task_self(), TASK_KERNEL_PORT, &movable_port);
549 T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "task_get_special_port(..TASK_KERNEL_PORT..)");
553 kr = task_read_for_pid(mach_task_self(), getpid(), &read_port);
554 T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "task_read_for_pid()");
558 kr = task_inspect_for_pid(mach_task_self(), getpid(), &inspect_port);
559 T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "task_inspect_for_pid()");
563 kr = task_name_for_pid(mach_task_self(), getpid(), &name_port);
564 T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "task_name_for_pid()");
607 kr = thread_get_special_port(th_control_port, THREAD_KERNEL_PORT, &th_movable_port);
608 T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "thread_get_special_port(..THREAD_KERNEL_PORT..)");
612 kr = thread_get_special_port(th_control_port, THREAD_READ_PORT, &th_read_port);
613 T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "thread_get_special_port(..THREAD_READ_PORT..)");
617 kr = thread_get_special_port(th_control_port, THREAD_INSPECT_PORT, &th_inspect_port);
618 T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "thread_get_special_port(..THREAD_INSPECT_PORT..)");