/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/benchmarks/ |
H A D | fork.c | 48 int pid; in start_process_on() local 50 pid = fork(); in start_process_on() 51 if (pid == -1) { in start_process_on() 56 if (pid) in start_process_on() 88 pid_t pid = fork(); in bench_fork() local 89 if (pid == -1) { in bench_fork() 93 if (pid == 0) { in bench_fork() 98 pid = waitpid(pid, NULL, 0); in bench_fork() 99 if (pid in bench_fork() 110 pid_t pid = vfork(); bench_vfork() local [all...] |
/third_party/musl/libc-test/src/functionalext/fortify/ |
H A D | socket_ext.c | 63 int pid = fork(); in send_0010() local 64 switch (pid) { in send_0010() 72 waitpid(pid, &status, WUNTRACED); in send_0010() 76 kill(pid, SIGCONT); in send_0010() 98 int pid = fork(); in recv_0010() local 99 switch (pid) { in recv_0010() 107 waitpid(pid, &status, WUNTRACED); in recv_0010() 111 kill(pid, SIGCONT); in recv_0010() 160 int pid = fork(); in sendto_0010() local 161 switch (pid) { in sendto_0010() 195 int pid = fork(); recvfrom_0010() local [all...] |
H A D | select_test.c | 55 int pid = fork(); in fd_set_0020() local 58 switch (pid) { in fd_set_0020() 67 waitpid(pid, &status, WUNTRACED); in fd_set_0020() 71 kill(pid, SIGCONT); in fd_set_0020() 91 int pid = fork(); in fd_set_0030() local 94 switch (pid) { in fd_set_0030() 103 waitpid(pid, &status, WUNTRACED); in fd_set_0030() 107 kill(pid, SIGCONT); in fd_set_0030() 144 int pid = fork(); in fd_clr_0020() local 147 switch (pid) { in fd_clr_0020() 180 int pid = fork(); fd_clr_0030() local [all...] |
/third_party/rust/crates/nix/src/sys/ptrace/ |
H A D | bsd.rs | 65 pid: Pid, in ptrace_other() 71 libc::pid_t::from(pid), in ptrace_other() 91 /// Attaches to the process specified by `pid`, making it a tracee of the calling process. 92 pub fn attach(pid: Pid) -> Result<()> { in attach() 94 ptrace_other(Request::PT_ATTACH, pid, ptr::null_mut(), 0).map(drop) in attach() 100 /// Detaches from the process specified by `pid` allowing it to run freely, optionally delivering a 102 pub fn detach<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> { in detach() 108 ptrace_other(Request::PT_DETACH, pid, ptr::null_mut(), data).map(drop) in detach() 114 /// Continues the execution of the process with PID `pid`, optionally 116 pub fn cont<T: Into<Option<Signal>>>(pid [all...] |
/kernel/liteos_a/testsuites/unittest/extended/liteipc/smoke/ |
H A D | liteipc_test_002.cpp | 185 pid_t farPid, sonPid, pid; in LiteIpcTest() local 191 pid = fork(); in LiteIpcTest() 192 ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT1); in LiteIpcTest() 193 if (pid == 0) { in LiteIpcTest() 199 pid = fork(); in LiteIpcTest() 200 ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT1); in LiteIpcTest() 201 if (pid == 0) { in LiteIpcTest() 206 pid in LiteIpcTest() 243 pid_t pid = fork(); TestCase() local [all...] |
/kernel/liteos_a/testsuites/unittest/process/basic/process/smoke/ |
H A D | process_test_029.cpp | 48 pid_t pid, pid1; in TestCase() local 50 pid = fork(); in TestCase() 51 ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. in TestCase() 53 if (pid == 0) { in TestCase() 60 ret = setpgid(pid, pid); in TestCase() 63 ret = waitpid(pid, &status, 0); in TestCase() 64 ICUNIT_ASSERT_EQUAL(ret, pid, re in TestCase() [all...] |
/third_party/ltp/include/ |
H A D | tst_process_state.h | 7 * These functions helps you wait till a process with given pid changes state. 29 #define TST_PROCESS_STATE_WAIT(pid, state, msec_timeout) \ 31 (pid), (state), (msec_timeout)) 34 * Check that a given pid is present on the system 36 #define TST_PROCESS_EXIT_WAIT(pid, msec_timeout) \ 37 tst_process_exit_wait((pid), (msec_timeout)) 66 int tst_process_state_wait2(pid_t pid, const char state); 68 #define TST_PROCESS_STATE_WAIT(cleanup_fn, pid, state) \ 70 (pid), (state), 0) 74 void (*cleanup_fn)(void), pid_t pid, [all...] |
/third_party/ltp/lib/ |
H A D | tst_clone.c | 21 pid_t pid = -1; in tst_clone() local 27 pid = syscall(__NR_clone3, &args, sizeof(args)); in tst_clone() 29 if (pid == -1 && errno != ENOSYS) in tst_clone() 32 if (pid != -1) in tst_clone() 33 return pid; in tst_clone() 38 pid = syscall(__NR_clone, NULL, flags); in tst_clone() 40 pid = syscall(__NR_clone, flags, NULL); in tst_clone() 43 if (pid == -1) in tst_clone() 46 return pid; in tst_clone()
|
/kernel/linux/linux-5.10/tools/perf/scripts/python/ |
H A D | netdev-times.py | 142 event['pid'], event['comm'])) 232 def irq__softirq_entry(name, context, cpu, sec, nsec, pid, comm, callchain, vec): 235 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec) 238 def irq__softirq_exit(name, context, cpu, sec, nsec, pid, comm, callchain, vec): 241 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec) 244 def irq__softirq_raise(name, context, cpu, sec, nsec, pid, comm, callchain, vec): 247 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec) 250 def irq__irq_handler_entry(name, context, cpu, sec, nsec, pid, comm, 252 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, 256 def irq__irq_handler_exit(name, context, cpu, sec, nsec, pid, com [all...] |
/kernel/linux/linux-6.6/tools/perf/scripts/python/ |
H A D | netdev-times.py | 142 event['pid'], event['comm'])) 232 def irq__softirq_entry(name, context, cpu, sec, nsec, pid, comm, callchain, vec): 235 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec) 238 def irq__softirq_exit(name, context, cpu, sec, nsec, pid, comm, callchain, vec): 241 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec) 244 def irq__softirq_raise(name, context, cpu, sec, nsec, pid, comm, callchain, vec): 247 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec) 250 def irq__irq_handler_entry(name, context, cpu, sec, nsec, pid, comm, 252 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, 256 def irq__irq_handler_exit(name, context, cpu, sec, nsec, pid, com [all...] |
/kernel/liteos_a/testsuites/unittest/process/basic/process/full/ |
H A D | process_test_032.cpp | 60 pid_t pid, pid1; in TestCase() local 62 pid = fork(); in TestCase() 63 ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. in TestCase() 65 if (pid == 0) { in TestCase() 72 ret = setpgid(pid, pid); in TestCase() 80 Child2(currGid, pid); in TestCase() 86 ret = waitpid(pid, in TestCase() [all...] |
H A D | process_test_034.cpp | 58 pid_t pid, pid1; in TestCase() local 60 pid = fork(); in TestCase() 61 ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. in TestCase() 63 if (pid == 0) { in TestCase() 70 ICUNIT_GOTO_NOT_EQUAL(pid1, pid, pid1, EXIT); in TestCase() 73 Child2(currGid, pid); in TestCase() 79 ret = setpgid(pid1, pid); in TestCase() 83 ret = waitpid(pid, in TestCase() [all...] |
H A D | process_test_051.cpp | 39 pid_t pid; in TestThread() local 48 pid = fork(); in TestThread() 50 ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. in TestThread() 51 if (pid == 0) { in TestThread() 56 ret = waitpid(pid, NULL, 0); in TestThread() 57 ICUNIT_ASSERT_EQUAL(ret, pid, ret); in TestThread() 69 pid_t pid; in Testcase() local 89 pid in Testcase() [all...] |
H A D | process_test_049.cpp | 56 pid_t pid = fork(); in TestThread() local 58 ICUNIT_GOTO_WITHIN_EQUAL(pid, 0, 100000, pid, EXIT); // 100000, assert pid equal to this. in TestThread() 59 if (pid == 0) { in TestThread() 66 ret = waitpid(pid, NULL, 0); in TestThread() 67 printf("waitpid ret : %d errno : %d pid : %d getpid : %d\n", ret, errno, pid, getpid()); in TestThread() 69 ICUNIT_ASSERT_EQUAL(ret, pid, ret); in TestThread() 84 pid_t pid; in Testcase() local [all...] |
/third_party/node/test/parallel/ |
H A D | test-process-kill-pid.js | 26 // Test variants of pid 33 // String(process.pid): TypeError 39 // process.pid, String(process.pid): ourself 45 message: 'The "pid" argument must be of type number.' + 73 process._kill = function(pid, sig) { 74 getPid = pid; 106 kill(process.pid, 'SIGHUP', process.pid, 1); 107 kill(process.pid, undefine [all...] |
/kernel/linux/linux-5.10/drivers/net/wan/ |
H A D | hdlc_ppp.c | 66 u16 pid; /* protocol ID */ member 109 static inline struct proto* get_proto(struct net_device *dev, u16 pid) in get_proto() argument 113 switch (pid) { in get_proto() 125 static inline const char* proto_name(u16 pid) in proto_name() argument 127 switch (pid) { in proto_name() 204 static void ppp_tx_cp(struct net_device *dev, u16 pid, u8 code, in ppp_tx_cp() argument 217 if (pid == PID_LCP && (code == LCP_ECHO_REQ || code == LCP_ECHO_REPLY)) in ppp_tx_cp() 247 proto_name(pid), code_names[code], id, debug_buffer); in ppp_tx_cp() 250 ppp_hard_header(skb, dev, pid, NULL, NULL, 0); in ppp_tx_cp() 302 static void ppp_cp_event(struct net_device *dev, u16 pid, u1 argument 373 ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id, unsigned int req_len, const u8 *data) ppp_cp_parse_cr() argument 445 u16 pid; ppp_rx() local [all...] |
/kernel/linux/linux-6.6/drivers/net/wan/ |
H A D | hdlc_ppp.c | 66 u16 pid; /* protocol ID */ member 110 static inline struct proto *get_proto(struct net_device *dev, u16 pid) in get_proto() argument 114 switch (pid) { in get_proto() 126 static inline const char *proto_name(u16 pid) in proto_name() argument 128 switch (pid) { in proto_name() 204 static void ppp_tx_cp(struct net_device *dev, u16 pid, u8 code, in ppp_tx_cp() argument 217 if (pid == PID_LCP && (code == LCP_ECHO_REQ || code == LCP_ECHO_REPLY)) in ppp_tx_cp() 246 proto_name(pid), code_names[code], id, debug_buffer); in ppp_tx_cp() 249 ppp_hard_header(skb, dev, pid, NULL, NULL, 0); in ppp_tx_cp() 299 static void ppp_cp_event(struct net_device *dev, u16 pid, u1 argument 369 ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id, unsigned int req_len, const u8 *data) ppp_cp_parse_cr() argument 442 u16 pid; ppp_rx() local [all...] |
/test/xts/acts/kernel_lite/mem_posix/src/ |
H A D | MremapApiTest.cpp | 83 pid_t pid = fork(); in HWTEST_F() local 84 EXPECT_TRUE(pid >= 0) << "Fork Error"; in HWTEST_F() 85 if (pid == 0) { in HWTEST_F() 99 WaitProcExitedOK(pid); in HWTEST_F() 125 pid_t pid = fork(); in HWTEST_F() local 126 EXPECT_TRUE(pid >= 0) << "Fork Error"; in HWTEST_F() 127 if (pid == 0) { in HWTEST_F() 137 ExpectProcCrashed(pid); in HWTEST_F() 165 pid_t pid = fork(); in HWTEST_F() local 166 EXPECT_TRUE(pid > in HWTEST_F() 209 pid_t pid = fork(); HWTEST_F() local 255 pid_t pid = fork(); HWTEST_F() local 307 pid_t pid = fork(); HWTEST_F() local 359 pid_t pid = fork(); HWTEST_F() local 415 pid_t pid = fork(); HWTEST_F() local [all...] |
/kernel/linux/linux-6.6/kernel/bpf/ |
H A D | bpf_task_storage.c | 7 #include <linux/pid.h> 95 struct pid *pid; in bpf_pid_task_storage_lookup_elem() local 99 pid = pidfd_get_pid(fd, &f_flags); in bpf_pid_task_storage_lookup_elem() 100 if (IS_ERR(pid)) in bpf_pid_task_storage_lookup_elem() 101 return ERR_CAST(pid); in bpf_pid_task_storage_lookup_elem() 107 task = pid_task(pid, PIDTYPE_PID); in bpf_pid_task_storage_lookup_elem() 116 put_pid(pid); in bpf_pid_task_storage_lookup_elem() 119 put_pid(pid); in bpf_pid_task_storage_lookup_elem() 129 struct pid *pi in bpf_pid_task_storage_update_elem() local 180 struct pid *pid; bpf_pid_task_storage_delete_elem() local [all...] |
/kernel/linux/linux-6.6/tools/bpf/runqslower/ |
H A D | runqslower.bpf.c | 30 u32 pid = t->pid; in trace_enqueue() local 33 if (!pid || (targ_pid && targ_pid != pid)) in trace_enqueue() 74 u32 pid; in handle__sched_switch() local 80 pid = next->pid; in handle__sched_switch() 82 /* For pid mismatch, save a bpf_task_storage_get */ in handle__sched_switch() 83 if (!pid || (targ_pid && targ_pid != pid)) in handle__sched_switch() [all...] |
/kernel/liteos_a/testsuites/unittest/container/smoke/ |
H A D | It_time_container_004.cpp | 54 static int WriteProcTime(int pid) in WriteProcTime() argument 64 ret = sprintf_s(path, STR_LEN, "/proc/%d/time_offsets", pid); in WriteProcTime() 103 auto pid = clone(childFunc, stackTop, CLONE_NEWTIME | SIGCHLD, &tp); in TimeContainerUnshare() local 104 ASSERT_TRUE(pid != -1); in TimeContainerUnshare() 106 ret = waitpid(pid, &status, 0); in TimeContainerUnshare() 107 ASSERT_EQ(ret, pid); in TimeContainerUnshare() 121 auto pid = fork(); in ItTimeContainer004() local 122 ASSERT_TRUE(pid != -1); in ItTimeContainer004() 123 if (pid == 0) { in ItTimeContainer004() 127 auto ret = waitpid(pid, in ItTimeContainer004() [all...] |
H A D | It_time_container_005.cpp | 54 static int WriteProcTime(int pid) in WriteProcTime() argument 64 ret = sprintf_s(path, STR_LEN, "/proc/%d/time_offsets", pid); in WriteProcTime() 103 auto pid = clone(childFunc, stackTop, CLONE_NEWTIME | SIGCHLD, &tp); in TimeContainerUnshare() local 104 ASSERT_TRUE(pid != -1); in TimeContainerUnshare() 106 ret = waitpid(pid, &status, 0); in TimeContainerUnshare() 107 ASSERT_EQ(ret, pid); in TimeContainerUnshare() 121 auto pid = fork(); in ItTimeContainer005() local 122 ASSERT_TRUE(pid != -1); in ItTimeContainer005() 123 if (pid == 0) { in ItTimeContainer005() 127 auto ret = waitpid(pid, in ItTimeContainer005() [all...] |
/third_party/ltp/testcases/kernel/containers/pidns/ |
H A D | pidns05.c | 54 int pid; in find_cinit_pids() local 61 for (pid = 2; pid < pid_max; pid++) { in find_cinit_pids() 62 if (pid == parentpid) in find_cinit_pids() 65 pgid2 = getpgid(pid); in find_cinit_pids() 68 pids[next] = pid; in find_cinit_pids() 87 pid_t pid; in run() local 89 pid = SAFE_CLONE(&clone_args); in run() 90 if (!pid) { in run() [all...] |
/third_party/ltp/testcases/kernel/syscalls/getpid/ |
H A D | getpid01.c | 17 pid_t pid_max, pid; in verify_getpid() local 23 pid = SAFE_FORK(); in verify_getpid() 24 if (pid == 0) { in verify_getpid() 25 pid = getpid(); in verify_getpid() 27 /* pid should not be 1 or out of maximum */ in verify_getpid() 28 if (1 < pid && pid <= pid_max) in verify_getpid() 29 tst_res(TPASS, "getpid() returns %d", pid); in verify_getpid() 32 "getpid() returns out of range: %d", pid); in verify_getpid()
|
/third_party/selinux/libselinux/src/ |
H A D | procattr.c | 83 static int openattr(pid_t pid, const char *attr, int flags) in openattr() argument 89 if (pid > 0) { in openattr() 90 rc = asprintf(&path, "/proc/%d/attr/%s", pid, attr); in openattr() 91 } else if (pid == 0) { in openattr() 115 pid_t pid, const char *attr) in getprocattrcon_raw() 159 fd = openattr(pid, attr, O_RDONLY | O_CLOEXEC); in getprocattrcon_raw() 198 pid_t pid, const char *attr) in getprocattrcon() 203 ret = getprocattrcon_raw(&rcontext, pid, attr); in getprocattrcon() 214 pid_t pid, const char *attr) in setprocattrcon_raw() 251 fd = openattr(pid, att in setprocattrcon_raw() 114 getprocattrcon_raw(char ** context, pid_t pid, const char *attr) getprocattrcon_raw() argument 197 getprocattrcon(char ** context, pid_t pid, const char *attr) getprocattrcon() argument 213 setprocattrcon_raw(const char * context, pid_t pid, const char *attr) setprocattrcon_raw() argument 282 setprocattrcon(const char * context, pid_t pid, const char *attr) setprocattrcon() argument [all...] |