/third_party/ltp/testcases/kernel/syscalls/fanotify/ |
H A D | fanotify19.c | 142 pid_t pid = getpid(); in test_fanotify() local 204 "pid=%u fd=%d", in test_fanotify() 206 (unsigned int) event->pid, in test_fanotify() 208 } else if ((!tc->fork && event->pid != pid) || in test_fanotify() 209 (tc->fork && event->pid != 0)) { in test_fanotify() 211 "Received unexpected pid in event: " in test_fanotify() 212 "mask=%llx pid=%u (expected %u) fd=%d", in test_fanotify() 214 (unsigned int) event->pid, in test_fanotify() 215 (tc->fork ? 0 : pid), in test_fanotify() [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/filesystems/binderfs/ |
H A D | binderfs_test.c | 169 static int wait_for_pid(pid_t pid) in wait_for_pid() argument 174 ret = waitpid(pid, &status, 0); in wait_for_pid() 228 static int write_id_mapping(enum idmap_type type, pid_t pid, const char *buf, in write_id_mapping() argument 238 snprintf(path, sizeof(path), "/proc/%d/setgroups", pid); in write_id_mapping() 253 ret = snprintf(path, sizeof(path), "/proc/%d/uid_map", pid); in write_id_mapping() 256 ret = snprintf(path, sizeof(path), "/proc/%d/gid_map", pid); in write_id_mapping() 306 static void change_idmaps(struct __test_metadata *_metadata, int syncfds[2], pid_t pid) in change_idmaps() argument 320 ret = write_id_mapping(UID_MAP, pid, id_map, strlen(id_map)); in change_idmaps() 326 ret = write_id_mapping(GID_MAP, pid, id_map, strlen(id_map)); in change_idmaps() 365 pid_t pid; in TEST() local 488 pid_t pid; TEST() local [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/filesystems/binderfs/ |
H A D | binderfs_test.c | 187 static int wait_for_pid(pid_t pid) in wait_for_pid() argument 192 ret = waitpid(pid, &status, 0); in wait_for_pid() 246 static int write_id_mapping(enum idmap_type type, pid_t pid, const char *buf, in write_id_mapping() argument 256 snprintf(path, sizeof(path), "/proc/%d/setgroups", pid); in write_id_mapping() 271 ret = snprintf(path, sizeof(path), "/proc/%d/uid_map", pid); in write_id_mapping() 274 ret = snprintf(path, sizeof(path), "/proc/%d/gid_map", pid); in write_id_mapping() 324 static void change_idmaps(struct __test_metadata *_metadata, int syncfds[2], pid_t pid) in change_idmaps() argument 338 ret = write_id_mapping(UID_MAP, pid, id_map, strlen(id_map)); in change_idmaps() 344 ret = write_id_mapping(GID_MAP, pid, id_map, strlen(id_map)); in change_idmaps() 383 pid_t pid; in TEST() local 507 pid_t pid; TEST() local [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/powerpc/ptrace/ |
H A D | ptrace-pkey.c | 185 static int parent(struct shared_info *info, pid_t pid) in parent() argument 194 ret = ptrace_read_regs(pid, NT_PPC_PKEY, regs, 3); in parent() 211 ret = ptrace_read_regs(pid, NT_PPC_PKEY, regs, 3); in parent() 222 ret = ptrace_write_regs(pid, NT_PPC_PKEY, &info->amr2, 1); in parent() 236 ret = ptrace_write_regs(pid, NT_PPC_PKEY, &info->invalid_amr, 1); in parent() 252 ret = ptrace_write_regs(pid, NT_PPC_PKEY, regs, 2); in parent() 260 ret = ptrace_write_regs(pid, NT_PPC_PKEY, regs, 3); in parent() 267 ret = ptrace_read_regs(pid, NT_PPC_PKEY, regs, 3); in parent() 282 if (ret != pid) { in parent() 299 pid_t pid; in ptrace_pkey() local [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/arm64/fp/ |
H A D | sve-ptrace.c | 69 static struct user_sve_header *get_sve(pid_t pid, void **buf, size_t *size) in get_sve() argument 90 if (ptrace(PTRACE_GETREGSET, pid, NT_ARM_SVE, &iov)) in get_sve() 106 static int set_sve(pid_t pid, const struct user_sve_header *sve) in set_sve() argument 112 return ptrace(PTRACE_SETREGSET, pid, NT_ARM_SVE, &iov); in set_sve() 139 pid_t pid; in do_parent() local 154 pid = wait(&status); in do_parent() 155 if (pid == -1) { in do_parent() 164 if (pid != child) in do_parent() 177 if (ptrace(PTRACE_GETSIGINFO, pid, NULL, &si)) { in do_parent() 192 si.si_pid == pid) in do_parent() [all...] |
/kernel/linux/linux-6.6/tools/perf/util/ |
H A D | machine.h | 23 /* Native host kernel uses -1 as pid index in machine */ 44 pid_t pid; member 115 struct thread *machine__find_thread(struct machine *machine, pid_t pid, 171 struct machine *machines__add(struct machines *machines, pid_t pid, 173 struct machine *machines__find(struct machines *machines, pid_t pid); 174 struct machine *machines__findnew(struct machines *machines, pid_t pid); 175 struct machine *machines__find_guest(struct machines *machines, pid_t pid); 176 struct thread *machines__findnew_guest_code(struct machines *machines, pid_t pid); 177 struct thread *machine__findnew_guest_code(struct machine *machine, pid_t pid); 184 int machine__init(struct machine *machine, const char *root_dir, pid_t pid); [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/arm64/fp/ |
H A D | zt-ptrace.c | 54 static struct user_za_header *get_za(pid_t pid, void **buf, size_t *size) in get_za() argument 75 if (ptrace(PTRACE_GETREGSET, pid, NT_ARM_ZA, &iov)) in get_za() 91 static int set_za(pid_t pid, const struct user_za_header *za) in set_za() argument 97 return ptrace(PTRACE_SETREGSET, pid, NT_ARM_ZA, &iov); in set_za() 100 static int get_zt(pid_t pid, char zt[ZT_SIG_REG_BYTES]) in get_zt() argument 106 return ptrace(PTRACE_GETREGSET, pid, NT_ARM_ZT, &iov); in get_zt() 110 static int set_zt(pid_t pid, const char zt[ZT_SIG_REG_BYTES]) in set_zt() argument 116 return ptrace(PTRACE_SETREGSET, pid, NT_ARM_ZT, &iov); in set_zt() 258 pid_t pid; in do_parent() local 266 pid in do_parent() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/ptrace/ |
H A D | ptrace-pkey.c | 185 static int parent(struct shared_info *info, pid_t pid) in parent() argument 194 ret = ptrace_read_regs(pid, NT_PPC_PKEY, regs, 3); in parent() 211 ret = ptrace_read_regs(pid, NT_PPC_PKEY, regs, 3); in parent() 222 ret = ptrace_write_regs(pid, NT_PPC_PKEY, &info->amr2, 1); in parent() 236 ret = ptrace_write_regs(pid, NT_PPC_PKEY, &info->invalid_amr, 1); in parent() 252 ret = ptrace_write_regs(pid, NT_PPC_PKEY, regs, 2); in parent() 260 ret = ptrace_write_regs(pid, NT_PPC_PKEY, regs, 3); in parent() 267 ret = ptrace_read_regs(pid, NT_PPC_PKEY, regs, 3); in parent() 282 if (ret != pid) { in parent() 299 pid_t pid; in ptrace_pkey() local [all...] |
/kernel/linux/linux-6.6/kernel/trace/ |
H A D | pid_list.c | 93 static inline int pid_split(unsigned int pid, unsigned int *upper1, in pid_split() argument 99 /* In case a bad pid is passed in, then fail */ in pid_split() 100 if (unlikely(pid >= MAX_PID)) in pid_split() 103 *upper1 = (pid >> UPPER1_SHIFT) & UPPER_MASK; in pid_split() 104 *upper2 = (pid >> UPPER2_SHIFT) & UPPER_MASK; in pid_split() 105 *lower = pid & LOWER_MASK; in pid_split() 119 * trace_pid_list_is_set - test if the pid is set in the list 120 * @pid_list: The pid list to test 121 * @pid: The pid t 129 trace_pid_list_is_set(struct trace_pid_list *pid_list, unsigned int pid) trace_pid_list_is_set() argument 168 trace_pid_list_set(struct trace_pid_list *pid_list, unsigned int pid) trace_pid_list_set() argument 221 trace_pid_list_clear(struct trace_pid_list *pid_list, unsigned int pid) trace_pid_list_clear() argument 273 trace_pid_list_next(struct trace_pid_list *pid_list, unsigned int pid, unsigned int *next) trace_pid_list_next() argument 327 trace_pid_list_first(struct trace_pid_list *pid_list, unsigned int *pid) trace_pid_list_first() argument [all...] |
/third_party/rust/crates/rustix/src/backend/linux_raw/process/ |
H A D | syscalls.rs | 89 let pid: i32 = ret_usize_infallible(syscall_readonly!(__NR_getpid)) as __kernel_pid_t; 90 debug_assert!(pid > 0); 91 Pid::from_raw_nonzero(RawNonZeroPid::new_unchecked(pid as u32)) 104 pub(crate) fn getpgid(pid: Option<Pid>) -> io::Result<Pid> { 107 ret_usize(syscall_readonly!(__NR_getpgid, c_uint(Pid::as_raw(pid))))? as __kernel_pid_t; 194 pub(crate) fn sched_getaffinity(pid: Option<Pid>, cpuset: &mut RawCpuSet) -> io::Result<()> { 201 c_uint(Pid::as_raw(pid)), 214 pub(crate) fn sched_setaffinity(pid: Option<Pid>, cpuset: &RawCpuSet) -> io::Result<()> { 218 c_uint(Pid::as_raw(pid)), 283 pub(crate) fn getpriority_process(pid [all...] |
/kernel/linux/linux-6.6/drivers/android/ |
H A D | binder.c | 514 thread->pid == current->pid && !thread->process_todo) in binder_enqueue_thread_work_ilocked() 724 current->pid, nice, min_nice); in binder_set_nice() 728 binder_user_error("%d RLIMIT_NICE not set\n", current->pid); in binder_set_nice() 821 proc->pid, current->pid, node->debug_id, in binder_init_node_ilocked() 1162 proc->pid, new_ref->data.debug_id, new_ref->data.desc, in binder_get_ref_for_node_olocked() 1174 ref->proc->pid, ref->data.debug_id, ref->data.desc, in binder_cleanup_ref_olocked() 1202 ref->proc->pid, ref->data.debug_id, in binder_cleanup_ref_olocked() 1257 ref->proc->pid, re in binder_dec_ref_olocked() 6584 int pid = (unsigned long)m->private; proc_show() local [all...] |
/third_party/libuv/src/unix/ |
H A D | process.c | 110 pid_t pid; in uv__wait_children() local 134 pid = waitpid(process->pid, &status, options); in uv__wait_children() 135 while (pid == -1 && errno == EINTR); in uv__wait_children() 138 if (pid == 0) /* Not yet exited */ in uv__wait_children() 142 if (pid == -1) { in uv__wait_children() 150 assert(pid == process->pid); in uv__wait_children() 671 pid_t* pid) { in uv__spawn_resolve_and_spawn() 700 err = posix_spawn(pid, option in uv__spawn_resolve_and_spawn() 668 uv__spawn_resolve_and_spawn(const uv_process_options_t* options, posix_spawnattr_t* attrs, posix_spawn_file_actions_t* actions, pid_t* pid) uv__spawn_resolve_and_spawn() argument 768 uv__spawn_and_init_child_posix_spawn( const uv_process_options_t* options, int stdio_count, int (*pipes)[2], pid_t* pid, const uv__posix_spawn_fncs_t* posix_spawn_fncs) uv__spawn_and_init_child_posix_spawn() argument 809 uv__spawn_and_init_child_fork(const uv_process_options_t* options, int stdio_count, int (*pipes)[2], int error_fd, pid_t* pid) uv__spawn_and_init_child_fork() argument 850 uv__spawn_and_init_child( uv_loop_t* loop, const uv_process_options_t* options, int stdio_count, int (*pipes)[2], pid_t* pid) uv__spawn_and_init_child() argument 1091 uv_kill(int pid, int signum) uv_kill() argument [all...] |
/kernel/linux/linux-5.10/tools/testing/selftests/powerpc/mm/ |
H A D | large_vm_fork_separation.c | 28 pid_t pid; in test() local 47 pid = fork(); in test() 48 if (pid == 0) { in test() 51 pid = getpid(); in test() 52 printf("child writing %p = %d\n", p, pid); in test() 53 *p = pid; in test() 75 FAIL_IF(waitpid(pid, &status, 0) == -1); in test()
|
/kernel/linux/linux-5.10/tools/testing/selftests/nsfs/ |
H A D | owner.c | 31 pid_t pid; in main() local 37 pid = fork(); in main() 38 if (pid < 0) in main() 40 if (pid == 0) { in main() 55 snprintf(path, sizeof(path), "/proc/%d/ns/uts", pid); in main() 67 snprintf(path, sizeof(path), "/proc/%d/ns/user", pid); in main() 89 kill(pid, SIGKILL); in main()
|
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/tm/ |
H A D | tm-syscall.c | 38 pid_t pid; in getppid_tm() local 43 pid = getppid_scv_tm_suspended(); in getppid_tm() 45 pid = getppid_tm_suspended(); in getppid_tm() 48 pid = getppid_scv_tm_active(); in getppid_tm() 50 pid = getppid_tm_active(); in getppid_tm() 53 if (pid >= 0) in getppid_tm() 54 return pid; in getppid_tm()
|
/kernel/linux/linux-6.6/tools/testing/selftests/nsfs/ |
H A D | owner.c | 31 pid_t pid; in main() local 37 pid = fork(); in main() 38 if (pid < 0) in main() 40 if (pid == 0) { in main() 55 snprintf(path, sizeof(path), "/proc/%d/ns/uts", pid); in main() 67 snprintf(path, sizeof(path), "/proc/%d/ns/user", pid); in main() 89 kill(pid, SIGKILL); in main()
|
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/mm/ |
H A D | large_vm_fork_separation.c | 28 pid_t pid; in test() local 47 pid = fork(); in test() 48 if (pid == 0) { in test() 51 pid = getpid(); in test() 52 printf("child writing %p = %d\n", p, pid); in test() 53 *p = pid; in test() 75 FAIL_IF(waitpid(pid, &status, 0) == -1); in test()
|
/kernel/linux/linux-6.6/mm/kasan/ |
H A D | report_tags.c | 35 u32 pid; in kasan_complete_mode_report_info() local 71 pid = READ_ONCE(entry->pid); in kasan_complete_mode_report_info() 83 info->free_track.pid = pid; in kasan_complete_mode_report_info() 98 info->alloc_track.pid = pid; in kasan_complete_mode_report_info()
|
/kernel/liteos_a/testsuites/unittest/extended/signal/full/ |
H A D | signal_test_029.cpp | 43 int pid; in TestCase() local 51 pid = fork(); in TestCase() 52 if (pid < 0) { in TestCase() 55 } else if (pid == 0) { in TestCase() 102 ret = kill(pid, SIGUSR1); in TestCase() 105 ret = waitpid(pid, &status, 0); in TestCase() 106 ICUNIT_ASSERT_EQUAL(ret, pid, ret); in TestCase()
|
/kernel/liteos_a/testsuites/unittest/process/basic/process/full/ |
H A D | process_test_062.cpp | 46 pid_t pid; in TestCase() local 56 pid = fork(); in TestCase() 57 ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. in TestCase() 59 if (pid == 0) { in TestCase() 92 ret = waitpid(pid, &status, 0); in TestCase() 93 ICUNIT_GOTO_EQUAL(ret, pid, ret, EXIT); in TestCase()
|
H A D | process_test_064.cpp | 67 pid_t pid; in TestCase() local 74 ret = posix_spawnp(&pid, "/usr/bin/testsuits_app", NULL, NULL, childArgv, NULL); in TestCase() 78 ret = posix_spawnp(&pid, "/usr/bin/testsuits_app", NULL, NULL, NULL, childEnvp); in TestCase() 81 ret = posix_spawnp(&pid, "/bin", NULL, NULL, NULL, NULL); in TestCase() 87 ret = posix_spawnp(&pid, fileName, NULL, NULL, NULL, NULL); in TestCase() 94 ret = posix_spawnp(&pid, fileName, NULL, NULL, NULL, NULL); in TestCase() 98 ret = posix_spawnp(&pid, "test_spawnp", NULL, NULL, NULL, NULL); in TestCase()
|
/kernel/liteos_a/testsuites/unittest/process/basic/process/smoke/ |
H A D | process_test_012.cpp | 49 pid_t pid = fork(); in ThreadFunc001() local 50 ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. in ThreadFunc001() 52 if (pid == 0) { in ThreadFunc001() 56 ret = waitpid(pid, &status, 0); in ThreadFunc001() 57 ICUNIT_GOTO_EQUAL(ret, pid, ret, EXIT); in ThreadFunc001() 69 if (pid == 0) { in ThreadFunc001()
|
/kernel/liteos_a/testsuites/unittest/process/basic/pthread/smoke/ |
H A D | pthread_test_016.cpp | 75 pid_t pid; in TestCase() local 76 pid = fork(); in TestCase() 77 ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, The pid will never exceed 100000. in TestCase() 79 if (pid == 0) { in TestCase() 86 ret = waitpid(pid, &status, 0); in TestCase() 87 ICUNIT_ASSERT_EQUAL(ret, pid, ret); in TestCase()
|
H A D | pthread_test_015.cpp | 76 pid_t pid, pid1; in TestCase() local 77 pid = fork(); in TestCase() 78 ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, The pid will never exceed 100000. in TestCase() 80 if (pid == 0) { in TestCase() 87 ret = waitpid(pid, &status, 0); in TestCase() 88 ICUNIT_ASSERT_EQUAL(ret, pid, ret); in TestCase()
|
H A D | pthread_test_019.cpp | 101 pid_t pid; in TestCase() local 102 pid = fork(); in TestCase() 103 ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, The pid will never exceed 100000. in TestCase() 105 if (pid == 0) { in TestCase() 112 ret = waitpid(pid, &status, 0); in TestCase() 113 ICUNIT_ASSERT_EQUAL(ret, pid, ret); in TestCase()
|