| /freebsd-10-stable/contrib/netbsd-tests/bin/ps/ |
| D | t_ps.sh | 94 default_keywords='pid tty stat time command' 95 j_keywords='user pid ppid pgid sess jobc state tt time command' 96 l_keywords='uid pid ppid cpu pri nice vsz rss wchan state tt time command' 97 s_keywords='uid pid ppid cpu lid nlwp pri nice vsz rss wchan lstate tt ltime command' 98 u_keywords='user pid %cpu %mem vsz rss tt state start time command' 99 v_keywords='pid state time sl re pagein vsz rss lim tsiz %cpu %mem command' 209 "$(echo "${default_keywords}" | sed -e 's/pid/pid %cpu %mem/')" 211 "$(echo "${default_keywords}" | sed -e 's/pid/pid %cpu %mem/')" 213 "$(echo "${default_keywords}" | sed -e 's/pid/pid %cpu %mem/')" 227 check_heading_keywords '-o pid,%cpu,%mem' \ [all …]
|
| /freebsd-10-stable/contrib/netbsd-tests/lib/libc/sys/ |
| D | t_wait.c | 76 pid_t pid; in ATF_TC_BODY() local 78 switch (pid = fork()) { in ATF_TC_BODY() 80 ATF_REQUIRE(pid > 0); in ATF_TC_BODY() 85 ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); in ATF_TC_BODY() 88 ATF_REQUIRE(si.si_pid == pid); in ATF_TC_BODY() 111 pid_t pid; in ATF_TC_BODY() local 113 switch (pid = fork()) { in ATF_TC_BODY() 118 ATF_REQUIRE(pid > 0); in ATF_TC_BODY() 120 ATF_REQUIRE(kill(pid, SIGTERM) == 0); in ATF_TC_BODY() 121 ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); in ATF_TC_BODY() [all …]
|
| /freebsd-10-stable/tools/test/ptrace/ |
| D | scescx.c | 147 get_pathname(pid_t pid) in get_pathname() argument 156 name[3] = pid; in get_pathname() 163 pid, strerror(errno)); in get_pathname() 166 fprintf(stderr, "pid %d exited\n", pid); in get_pathname() 170 fprintf(stderr, "No cached pathname for process %d\n", pid); in get_pathname() 173 printf(TRACE "pid %d path %s\n", pid, pathname); in get_pathname() 177 wait_info(int pid, int status, struct ptrace_lwpinfo *lwpinfo) in wait_info() argument 180 printf(TRACE "pid %d wait %s", pid, in wait_info() 190 trace_sc(int pid) in trace_sc() argument 195 if (ptrace(PT_TO_SCE, pid, (caddr_t)1, 0) < 0) { in trace_sc() [all …]
|
| /freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/ |
| D | tst.printtype.ksh | 38 pid=$! 41 pid$pid::ff_getgameid:entry 44 print(*(pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t)))); 49 pid$pid::ff_getpartysize:entry 52 print(*(pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t)))); 57 pid$pid::ff_getsummons:entry 60 print(*(pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t)))); 67 kill -9 $pid
|
| D | tst.chasestrings.ksh | 39 pid=$! 42 pid$pid::has_princess:entry 45 this->t = (pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t))); 52 pid$pid::has_dungeons:entry 55 this->t = (pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t))); 62 pid$pid::has_villain:entry 65 this->t = (pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t))); 74 kill -9 $pid
|
| D | tst.printtypetarg.ksh | 39 pid=$! 41 $dtrace -p $pid -qs /dev/stdin <<EOF 42 pid\$target::ff_getgameid:entry 45 print(*(pid\`$t *)(copyin(arg0, sizeof (pid\`$t)))); 50 pid\$target::ff_getpartysize:entry 53 print(*(pid\`$t *)(copyin(arg0, sizeof (pid\`$t)))); 58 pid\$target::ff_getsummons:entry 61 print(*(pid\`$t *)(copyin(arg0, sizeof (pid\`$t)))); 68 kill -9 $pid
|
| /freebsd-10-stable/bin/pkill/tests/ |
| D | pkill-j_test.sh | 25 command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount & 28 command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount & 46 ! -f ${PWD}/${base}_1_1.pid && 47 ! -f ${PWD}/${base}_1_2.pid ; then 52 [ -f ${PWD}/${base}_1_1.pid ] && kill $(cat ${PWD}/${base}_1_1.pid) 53 [ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid) 59 command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount & 62 command=daemon -p ${PWD}/${base}_2_2.pid $sleep $sleep_amount & 68 [ ! -f ${PWD}/${base}_2_1.pid -a 69 ! -f ${PWD}/${base}_2_2.pid ] && kill $chpid3; then [all …]
|
| D | pgrep-j_test.sh | 25 command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount & 28 command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount & 45 $(cat ${PWD}/${base}_1_2.pid) | sort) 51 [ -f ${PWD}/${base}_1_1.pid ] && kill $(cat ${PWD}/${base}_1_1.pid) 52 [ -f ${PWD}/${base}_1_2.pid ] && kill $(cat ${PWD}/${base}_1_2.pid) 58 command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount & 61 command=daemon -p ${PWD}/${base}_2_2.pid $sleep $sleep_amount & 66 $(cat ${PWD}/${base}_2_2.pid) | sort) 72 [ -f ${PWD}/${base}_2_1.pid ] && kill $(cat ${PWD}/${base}_2_1.pid) 73 [ -f ${PWD}/${base}_2_2.pid ] && kill $(cat ${PWD}/${base}_2_2.pid) [all …]
|
| /freebsd-10-stable/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/ |
| D | dtest.pl | 123 if (-f "$opt_d/$pid.core") { 124 print README "; see $pid.core\n"; 132 if (-f "$opt_d/$pid.out") { 133 rename("$opt_d/$pid.out", "$opt_d/failure.$n/$pid.out"); 137 if (-f "$opt_d/$pid.err") { 138 rename("$opt_d/$pid.err", "$opt_d/failure.$n/$pid.err"); 142 if (-f "$opt_d/$pid.core") { 143 rename("$opt_d/$pid.core", "$opt_d/failure.$n/$pid.core"); 308 if (($pid = fork()) == -1) { 313 if ($pid == 0) { [all …]
|
| /freebsd-10-stable/lib/libproc/ |
| D | proc_create.c | 46 proc_init(pid_t pid, int flags, int status, struct proc_handle *phdl) in proc_init() argument 52 phdl->pid = pid; in proc_init() 59 mib[3] = pid; in proc_init() 63 DPRINTF("ERROR: cannot get pathname for child process %d", pid); in proc_init() 73 proc_attach(pid_t pid, int flags, struct proc_handle **pphdl) in proc_attach() argument 79 if (pid == 0 || pid == getpid()) in proc_attach() 91 error = proc_init(pid, flags, PS_RUN, phdl); in proc_attach() 95 if (ptrace(PT_ATTACH, phdl->pid, 0, 0) != 0) { in proc_attach() 97 DPRINTF("ERROR: cannot ptrace child process %d", pid); in proc_attach() 102 if (waitpid(pid, &status, WUNTRACED) == -1) { in proc_attach() [all …]
|
| /freebsd-10-stable/usr.sbin/autofs/ |
| D | popen.c | 59 struct pid { struct 60 SLIST_ENTRY(pid) next; 62 pid_t pid; argument 65 static SLIST_HEAD(, pid) pidlist = SLIST_HEAD_INITIALIZER(pidlist); argument 78 struct pid *cur, *p; in auto_popen() 79 pid_t pid; in auto_popen() local 91 cur = malloc(sizeof(struct pid)); in auto_popen() 113 switch (pid = fork()) { in auto_popen() 132 log_debugx("executing \"%s\" as pid %d", command, pid); in auto_popen() 140 cur->pid = pid; in auto_popen() [all …]
|
| /freebsd-10-stable/contrib/ofed/management/opensm/scripts/ |
| D | redhat-opensm.init.in | 61 sldd_pid_file=/var/run/sldd.pid 66 PID_FILE=/var/run/${bin}.pid 125 pid="" 131 [ -z "${p//[0-9]/}" -a -d "/proc/$p" ] && pid="$pid $p" 135 if [ -z "$pid" ]; then 136 pid=`pidof -o $$ -o $PPID -o %PPID -x $bin` 140 echo $"${bin} (pid $pid) is already running..." 176 local pid= 193 pid=`echo "$pid1 $pid2" | sed -e 's/\ /\n/g' | sort -n | uniq | sed -e 's/\n/\ /g'` 198 kill -15 $pid > /dev/null 2>&1 [all …]
|
| /freebsd-10-stable/tests/sys/file/ |
| D | flock_helper.c | 113 safe_waitpid(pid_t pid) in safe_waitpid() argument 120 while (waitpid(pid, &status, 0) != pid) { in safe_waitpid() 187 int pid; in test2() local 201 pid = fork(); in test2() 202 if (pid < 0) in test2() 205 if (pid == 0) { in test2() 232 kill(pid, SIGTERM); in test2() 233 safe_waitpid(pid); in test2() 258 int pid; in test3() local 272 pid = fork(); in test3() [all …]
|
| /freebsd-10-stable/contrib/gdb/gdb/ |
| D | pa64solib.h | 55 #define SOLIB_CREATE_CATCH_LOAD_HOOK(pid,tempflag, filename,cond_string) \ argument 56 pa64_solib_create_catch_load_hook (pid, tempflag, filename, cond_string) 63 #define SOLIB_CREATE_CATCH_UNLOAD_HOOK(pid,tempflag,filename, cond_string) \ argument 64 pa64_solib_create_catch_unload_hook (pid, tempflag, filename, cond_string) 73 #define SOLIB_HAVE_LOAD_EVENT(pid) \ argument 74 pa64_solib_have_load_event (pid) 88 #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \ argument 89 pa64_solib_loaded_library_pathname (pid) 98 #define SOLIB_HAVE_UNLOAD_EVENT(pid) \ argument 99 pa64_solib_have_unload_event (pid) [all …]
|
| D | inftarg.c | 114 int pid; in child_wait() local 122 pid = ptrace_wait (inferior_ptid, &status); in child_wait() 130 if (pid == -1) in child_wait() 146 if (target_has_exited (pid, status, &exit_status)) in child_wait() 152 if (!target_thread_alive (pid_to_ptid (pid))) in child_wait() 155 return pid_to_ptid (pid); in child_wait() 157 } while (pid != PIDGET (inferior_ptid)); /* Some other child died or stopped */ in child_wait() 160 return pid_to_ptid (pid); in child_wait() 185 pid_t pid = PIDGET (ptid); in child_thread_alive() local 187 return (kill (pid, 0) != -1); in child_thread_alive() [all …]
|
| D | somsolib.h | 68 #define SOLIB_CREATE_CATCH_LOAD_HOOK(pid,tempflag, filename,cond_string) \ argument 69 som_solib_create_catch_load_hook (pid, tempflag, filename, cond_string) 77 #define SOLIB_CREATE_CATCH_UNLOAD_HOOK(pid,tempflag,filename, cond_string) \ argument 78 som_solib_create_catch_unload_hook (pid, tempflag, filename, cond_string) 88 #define SOLIB_HAVE_LOAD_EVENT(pid) \ argument 89 som_solib_have_load_event (pid) 104 #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \ argument 105 som_solib_loaded_library_pathname (pid) 115 #define SOLIB_HAVE_UNLOAD_EVENT(pid) \ argument 116 som_solib_have_unload_event (pid) [all …]
|
| D | sparc-nat.c | 140 int pid; in fetch_inferior_registers() local 155 pid = TIDGET (inferior_ptid); in fetch_inferior_registers() 156 if (pid == 0) in fetch_inferior_registers() 157 pid = PIDGET (inferior_ptid); in fetch_inferior_registers() 169 if (ptrace (PTRACE_GETREGS, pid, (PTRACE_ARG3_TYPE) ®s, 0) == -1) in fetch_inferior_registers() 181 if (ptrace (PTRACE_GETFPREGS, pid, (PTRACE_ARG3_TYPE) &fpregs, 0) == -1) in fetch_inferior_registers() 192 int pid; in store_inferior_registers() local 196 pid = TIDGET (inferior_ptid); in store_inferior_registers() 197 if (pid == 0) in store_inferior_registers() 198 pid = PIDGET (inferior_ptid); in store_inferior_registers() [all …]
|
| /freebsd-10-stable/tests/sys/fifo/ |
| D | fifo_open.c | 105 pid_t pid; in run_in_process() local 107 pid = fork(); in run_in_process() 108 if (pid < 0) { in run_in_process() 113 if (pid == 0) in run_in_process() 117 *pidp = pid; in run_in_process() 128 wait_and_timeout(pid_t pid, int timeout, int *status, const char *errstr) in wait_and_timeout() argument 138 wpid = waitpid(pid, status, WNOHANG); in wait_and_timeout() 140 warn("%s: wait_and_timeout: waitpid %d", errstr, pid); in wait_and_timeout() 144 if (wpid == pid) in wait_and_timeout() 150 wpid = waitpid(pid, status, WNOHANG); in wait_and_timeout() [all …]
|
| /freebsd-10-stable/usr.bin/mail/ |
| D | popen.c | 49 int pid; member 55 int pid; member 102 int pid; in Popen() local 120 if ((pid = start_command(cmd, &nset, fd0, fd1, NULL, NULL, NULL)) < 0) { in Popen() 127 register_file(fp, 1, pid); in Popen() 161 register_file(FILE *fp, int pipe, int pid) in register_file() argument 169 fpp->pid = pid; in register_file() 196 return (p->pid); in file_pid() 213 int pid; in run_command() local 215 if ((pid = start_command(cmd, mask, infd, outfd, a0, a1, a2)) < 0) in run_command() [all …]
|
| /freebsd-10-stable/contrib/netbsd-tests/lib/libc/stdlib/ |
| D | t_exit.c | 59 pid_t pid; in ATF_TC_BODY() local 62 pid = fork(); in ATF_TC_BODY() 63 ATF_REQUIRE(pid >= 0); in ATF_TC_BODY() 65 if (pid == 0) { in ATF_TC_BODY() 92 pid_t pid; in ATF_TC_BODY() local 95 pid = fork(); in ATF_TC_BODY() 96 ATF_REQUIRE(pid >= 0); in ATF_TC_BODY() 98 if (pid == 0) { in ATF_TC_BODY() 119 pid_t pid; in ATF_TC_BODY() local 123 pid = fork(); in ATF_TC_BODY() [all …]
|
| /freebsd-10-stable/contrib/amd/scripts/ |
| D | ctl-amd.in | 25 pid=`amq -p 2>/dev/null` 26 if test "$pid" != "" 28 kill $pid 34 pid=`${pscmd} 2>/dev/null | grep "$1" | sed -e 's/^ *//' -e 's/ .*//'` 35 if test "$pid" != "" 37 kill $pid 43 pid=`${pscmd} 2>/dev/null | grep "$1" | sed -e 's/^ *//' -e 's/ .*//'` 44 if test "$pid" != "" 46 kill $pid 52 pid=`${pscmd} 2>/dev/null | grep "$1" | sed -e 's/^ *//' -e 's/ .*//'` [all …]
|
| /freebsd-10-stable/tests/sys/kern/ |
| D | reaper.c | 46 pid_t parent, child, grandchild, pid; in ATF_TC_BODY() local 51 pid = waitpid(-1, NULL, WNOHANG); in ATF_TC_BODY() 52 ATF_REQUIRE(pid == -1 && errno == ECHILD); in ATF_TC_BODY() 79 pid = waitpid(child, &status, 0); in ATF_TC_BODY() 80 ATF_REQUIRE_EQ(child, pid); in ATF_TC_BODY() 87 pid = waitpid(-1, &status, 0); in ATF_TC_BODY() 88 ATF_REQUIRE(pid > 0 && pid != child); in ATF_TC_BODY() 99 pid_t parent, child, grandchild, pid; in ATF_TC_BODY() local 103 pid = waitpid(-1, NULL, WNOHANG); in ATF_TC_BODY() 104 ATF_REQUIRE(pid == -1 && errno == ECHILD); in ATF_TC_BODY() [all …]
|
| /freebsd-10-stable/lib/libc/gen/ |
| D | popen.c | 58 struct pid { struct 59 SLIST_ENTRY(pid) next; 61 pid_t pid; member 63 static SLIST_HEAD(, pid) pidlist = SLIST_HEAD_INITIALIZER(pidlist); 73 struct pid *cur; 75 int pdes[2], pid, twoway, cloexec; local 78 struct pid *p; 97 if ((cur = malloc(sizeof(struct pid))) == NULL) { 123 switch (pid = vfork()) { 183 cur->pid = pid; [all …]
|
| /freebsd-10-stable/tests/sys/kqueue/libkqueue/ |
| D | proc.c | 40 pid_t pid; in add_and_delete() local 43 pid = fork(); in add_and_delete() 44 if (pid == 0) { in add_and_delete() 53 printf(" -- child created (pid %d)\n", (int) pid); in add_and_delete() 58 kevent_add(kqfd, &kev, pid, EVFILT_PROC, EV_ADD, 0, 0, NULL); in add_and_delete() 67 kevent_add(kqfd, &kev, pid, EVFILT_PROC, EV_DELETE, 0, 0, NULL); in add_and_delete() 68 if (kill(pid, SIGKILL) < 0) in add_and_delete() 82 pid_t pid; in proc_track() local 97 pid = fork(); in proc_track() 98 if (pid == 0) { /* Child */ in proc_track() [all …]
|
| /freebsd-10-stable/usr.bin/truss/ |
| D | setup.c | 74 pid_t pid; in setup_and_wait() local 76 pid = vfork(); in setup_and_wait() 77 if (pid == -1) in setup_and_wait() 79 if (pid == 0) { /* Child */ in setup_and_wait() 86 if (waitpid(pid, NULL, 0) < 0) in setup_and_wait() 89 new_proc(info, pid); in setup_and_wait() 96 start_tracing(struct trussinfo *info, pid_t pid) in start_tracing() argument 102 ret = ptrace(PT_ATTACH, pid, NULL, 0); in start_tracing() 108 if (waitpid(pid, NULL, 0) < 0) in start_tracing() 111 new_proc(info, pid); in start_tracing() [all …]
|