Home
last modified time | relevance | path

Searched full:pid (Results 1 – 25 of 2132) sorted by relevance

12345678910>>...86

/freebsd/usr.sbin/daemon/tests/
H A Ddaemon_test.sh30 atf_set "descr" "daemon should write pid files for itself and its child"
33 daemon -P daemon.pid -p sleep.pid sleep 300
34 atf_check -s exit:0 test -f daemon.pid
35 atf_check -s exit:0 -o match:"daemon: sleep" ps -p `cat daemon.pid`
36 atf_check -s exit:0 test -f sleep.pid
37 atf_check -s exit:0 -o match:"[0-9] sleep 300$" ps -p `cat sleep.pid`
40 if [ -f daemon.pid ]; then
41 daemon_pid=`cat daemon.pid`
44 sleep_pid=`cat sleep.pid`
58 daemon -p ${PWD}/sleep.pid -c bin/sleep 300
[all …]
/freebsd/usr.bin/renice/tests/
H A Drenice_test.sh16 local pid=$1
18 local actual="$(ps -o nice= -p $pid)"
27 local pid nice incr
29 pid=$!
30 nice="$(ps -o nice= -p $pid)"
32 _renice $((nice+incr)) $pid
33 atf_check_nice_value $pid $((nice+incr))
34 kill $pid
42 local pid nice incr
44 pid=$!
[all …]
/freebsd/contrib/netbsd-tests/bin/ps/
H A Dt_ps.sh94 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'
102 # Convert a list of keywords like "pid comm" to a regexp
103 # like " *PID COMMAND *"
203 "the pid column"
209 "$(echo "${default_keywords}" | sed -e 's/pid/pid %cpu %mem/')"
[all …]
/freebsd/bin/pkill/tests/
H A Dpkill-j_test.sh24 command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount &
27 command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount &
48 ! test -f "${PWD}/${base}_1_1.pid" &&
49 ! test -f "${PWD}/${base}_1_2.pid" ; then
54 [ -f ${PWD}/${base}_1_1.pid ] && kill "$(cat ${PWD}/${base}_1_1.pid)"
55 [ -f ${PWD}/${base}_1_2.pid ] && kill "$(cat ${PWD}/${base}_1_2.pid)"
61 command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount &
64 command=daemon -p ${PWD}/${base}_2_2.pid $sleep $sleep_amount &
70 ! test -f ${PWD}/${base}_2_1.pid &&
71 ! test -f ${PWD}/${base}_2_2.pid && kill $chpid3; then
[all …]
H A Dpgrep-j_test.sh24 command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount &
27 command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount &
44 pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_1_1.pid)" \
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 &
65 pid2=$(printf "%s\n%s" "$(cat ${PWD}/${base}_2_1.pid)" \
66 "$(cat ${PWD}/${base}_2_2.pid)" | sort)
[all …]
/freebsd/tests/sys/audit/
H A Dprocess-control.c51 static pid_t pid; variable
67 pid = getpid(); in ATF_TC_BODY()
68 snprintf(pcregex, sizeof(pcregex), "fork.*%d.*return,success", pid); in ATF_TC_BODY()
72 ATF_REQUIRE((pid = fork()) != -1); in ATF_TC_BODY()
73 if (pid) in ATF_TC_BODY()
100 ATF_REQUIRE((pid = fork()) != -1); in ATF_TC_BODY()
101 if (pid) { in ATF_TC_BODY()
102 snprintf(pcregex, sizeof(pcregex), "exit.*%d.*success", pid); in ATF_TC_BODY()
128 pid = getpid(); in ATF_TC_BODY()
129 snprintf(pcregex, sizeof(pcregex), "rfork.*%d.*return,success", pid); in ATF_TC_BODY()
[all …]
H A Dadministrative.c48 static pid_t pid; variable
69 pid = getpid(); in ATF_TC_BODY()
70 snprintf(adregex, sizeof(adregex), "settimeofday.*%d.*success", pid); in ATF_TC_BODY()
97 pid = getpid(); in ATF_TC_BODY()
98 snprintf(adregex, sizeof(adregex), "settimeofday.*%d.*failure", pid); in ATF_TC_BODY()
126 pid = getpid(); in ATF_TC_BODY()
127 snprintf(adregex, sizeof(adregex), "clock_settime.*%d.*success", pid); in ATF_TC_BODY()
153 pid = getpid(); in ATF_TC_BODY()
154 snprintf(adregex, sizeof(adregex), "clock_settime.*%d.*failure", pid); in ATF_TC_BODY()
180 pid = getpid(); in ATF_TC_BODY()
[all …]
/freebsd/contrib/netbsd-tests/lib/libc/sys/
H A Dt_wait.c80 pid_t pid; in ATF_TC_BODY() local
82 switch (pid = fork()) { in ATF_TC_BODY()
84 ATF_REQUIRE(pid > 0); in ATF_TC_BODY()
89 ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); in ATF_TC_BODY()
92 ATF_REQUIRE(si.si_pid == pid); in ATF_TC_BODY()
115 pid_t pid; in ATF_TC_BODY() local
117 switch (pid = fork()) { in ATF_TC_BODY()
122 ATF_REQUIRE(pid > 0); in ATF_TC_BODY()
124 ATF_REQUIRE(kill(pid, SIGTERM) == 0); in ATF_TC_BODY()
125 ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); in ATF_TC_BODY()
[all …]
/freebsd/tools/test/ptrace/
H A Dscescx.c150 get_pathname(pid_t pid) in get_pathname() argument
159 name[3] = pid; in get_pathname()
166 pid, strerror(errno)); in get_pathname()
169 fprintf(stderr, "pid %d exited\n", pid); in get_pathname()
173 fprintf(stderr, "No cached pathname for process %d\n", pid); in get_pathname()
176 printf(TRACE "pid %d path %s\n", pid, pathname); in get_pathname()
180 wait_info(int pid, int status, struct ptrace_lwpinfo *lwpinfo) in wait_info() argument
185 printf(TRACE "pid %d wait %s", pid, in wait_info()
218 trace_sc(int pid) in trace_sc() argument
224 if (ptrace(PT_TO_SCE, pid, (caddr_t)1, 0) < 0) { in trace_sc()
[all …]
/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/
H A Dtst.printtype.ksh38 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
H A Dtst.chasestrings.ksh39 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
/freebsd/contrib/bmake/unit-tests/
H A Dopt-debug-jobs.exp2 TokenPool_Take: pid <pid>, aborting NONE, running 0
3 TokenPool_Take: pid <pid> took a token
17 JobExec: target all, pid <pid> added to jobs table
19 job 0, status running, flags ---, pid <pid>
23 Process with pid <pid> exited/stopped with status 0.
24 JobFinish: target all, pid <pid>, status 0
25 TokenPool_Take: pid <pid>, aborting NONE, running 0
26 TokenPool_Take: pid <pid> took a token
H A Dopt-tracefile.exp4 <timestamp> 0 BEG <make-pid> <curdir>
5 <timestamp> 1 JOB <make-pid> <curdir> dependency1 <job-pid> --- OP_DEPENDS|OP_PHONY|OP_HAS_COMMANDS…
6 <timestamp> 1 DON <make-pid> <curdir> dependency1 <job-pid> --- OP_DEPENDS|OP_PHONY|OP_HAS_COMMANDS…
7 <timestamp> 1 JOB <make-pid> <curdir> dependency2 <job-pid> --- OP_DEPENDS|OP_PHONY|OP_HAS_COMMANDS…
8 <timestamp> 1 DON <make-pid> <curdir> dependency2 <job-pid> --- OP_DEPENDS|OP_PHONY|OP_HAS_COMMANDS…
9 <timestamp> 1 JOB <make-pid> <curdir> trace <job-pid> --- OP_DEPENDS|OP_PHONY|OP_HAS_COMMANDS|OP_DE…
10 <timestamp> 1 DON <make-pid> <curdir> trace <job-pid> --- OP_DEPENDS|OP_PHONY|OP_HAS_COMMANDS|OP_DE…
11 <timestamp> 0 END <make-pid> <curdir>
H A Dsh-errctl.exp2 TokenPool_Take: pid <pid>, aborting NONE, running 0
3 TokenPool_Take: pid <pid> took a token
19 JobExec: target all, pid <pid> added to jobs table
21 job 0, status running, flags ---, pid <pid>
25 TokenPool_Take: pid <pid>, aborting NONE, running 0
26 TokenPool_Take: pid <pid> took a token
/freebsd/contrib/bsnmp/snmpd/
H A Dsnmpd.sh35 PID=/var/run/snmpd.pid
41 if [ -r ${PID} ] ; then
42 if kill -0 `cat ${PID}` ; then
43 echo "snmpd already running -- pid `cat ${PID}`" >/dev/stderr
46 rm -f ${PID}
48 if ${SNMPD} -c ${CONF} -p ${PID} ; then
54 if [ -r ${PID} ] ; then
55 if kill -0 `cat ${PID}` ; then
56 if kill -15 `cat ${PID}` ; then
63 echo "stale pid file -- removing" >/dev/stderr
[all …]
/freebsd/contrib/capsicum-test/
H A Dprocdesc.cc25 // see and reap any specific pid. Define this to nothing for platforms
38 pid_t pid = -1; in pdwait4_()
39 int rc = pdgetpid(pd, &pid); in pdwait4_()
44 return wait4(pid, status, options, ru); in pdwait4_()
81 void CheckChildFinished(pid_t pid, bool signaled=false) { in CheckChildFinished() argument
86 rc = waitpid(pid, &status, __WALL); in CheckChildFinished()
91 } else if (rc == pid) { in CheckChildFinished()
95 EXPECT_EQ(pid, rc); in CheckChildFinished()
96 if (rc == pid) { in CheckChildFinished()
114 int pid = pdfork(&pd, 0); in TEST() local
[all …]
/freebsd/sys/compat/linux/
H A Dlinux_ptrace.c122 linux_ptrace_status(struct thread *td, pid_t pid, int status) in linux_ptrace_status() argument
130 error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); in linux_ptrace_status()
160 linux_ptrace_peek(struct thread *td, pid_t pid, void *addr, void *data) in linux_ptrace_peek() argument
164 error = kern_ptrace(td, PT_READ_I, pid, addr, 0); in linux_ptrace_peek()
175 linux_ptrace_setoptions(struct thread *td, pid_t pid, l_ulong data) in linux_ptrace_setoptions() argument
225 return (kern_ptrace(td, PT_SET_EVENT_MASK, pid, &mask, sizeof(mask))); in linux_ptrace_setoptions()
229 linux_ptrace_geteventmsg(struct thread *td, pid_t pid, l_ulong data) in linux_ptrace_geteventmsg() argument
237 linux_ptrace_getsiginfo(struct thread *td, pid_t pid, l_ulong data) in linux_ptrace_getsiginfo() argument
243 error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); in linux_ptrace_getsiginfo()
263 linux_ptrace_getregs(struct thread *td, pid_t pid, void *data) in linux_ptrace_getregs() argument
[all …]
/freebsd/usr.sbin/autofs/
H A Dpopen.c58 struct pid { struct
59 SLIST_ENTRY(pid) next;
61 pid_t pid; argument
64 static SLIST_HEAD(, pid) pidlist = SLIST_HEAD_INITIALIZER(pidlist); argument
77 struct pid *cur, *p; in auto_popen()
78 pid_t pid; in auto_popen() local
90 cur = malloc(sizeof(struct pid)); in auto_popen()
112 switch (pid = fork()) { in auto_popen()
131 log_debugx("executing \"%s\" as pid %d", command, pid); in auto_popen()
139 cur->pid = pid; in auto_popen()
[all …]
/freebsd/contrib/netbsd-tests/lib/libutil/
H A Dt_pidfile.c74 int pid; in check_pidfile() local
81 if (fscanf(file, "%d", &pid) == -1) in check_pidfile()
82 errx(EXIT_FAILURE, "Failed to read pid from pidfile '%s'", in check_pidfile()
85 printf("Read pid %d, current pid %d\n", pid, getpid()); in check_pidfile()
86 if (pid != getpid()) in check_pidfile()
87 errx(EXIT_FAILURE, "Pid in pidfile (%d) does not match " in check_pidfile()
88 "current pid (%d)", pid, getpid()); in check_pidfile()
110 pid_t pid; in run_child() local
112 pid = fork(); in run_child()
113 ATF_REQUIRE(pid != -1); in run_child()
[all …]
/freebsd/tests/sys/kern/
H A Dreaper.c45 pid_t parent, child, grandchild, pid; in ATF_TC_BODY() local
50 pid = waitpid(-1, NULL, WNOHANG); in ATF_TC_BODY()
51 ATF_REQUIRE(pid == -1 && errno == ECHILD); in ATF_TC_BODY()
78 pid = waitpid(child, &status, 0); in ATF_TC_BODY()
79 ATF_REQUIRE_EQ(child, pid); in ATF_TC_BODY()
86 pid = waitpid(-1, &status, 0); in ATF_TC_BODY()
87 ATF_REQUIRE(pid > 0 && pid != child); in ATF_TC_BODY()
98 pid_t parent, child, grandchild, pid; in ATF_TC_BODY() local
102 pid = waitpid(-1, NULL, WNOHANG); in ATF_TC_BODY()
103 ATF_REQUIRE(pid == -1 && errno == ECHILD); in ATF_TC_BODY()
[all …]
/freebsd/usr.bin/mail/
H A Dpopen.c45 pid_t pid; member
51 pid_t pid; member
100 pid_t pid; in Popen() local
117 pid = start_command(value("SHELL"), &nset, fd0, fd1, "-c", cmd, NULL); in Popen()
118 if (pid < 0) { in Popen()
125 register_file(fp, 1, pid); in Popen()
159 register_file(FILE *fp, int pipe, pid_t pid) in register_file() argument
167 fpp->pid = pid; in register_file()
194 return (p->pid); in file_pid()
210 pid_t pid; in start_commandv() local
[all …]
/freebsd/lib/libc/tests/stdlib/
H A Dlibc_exit_test.c59 pid_t pid; in ATF_TC_BODY() local
62 pid = fork(); in ATF_TC_BODY()
63 if (pid == 0) { in ATF_TC_BODY()
71 ATF_REQUIRE_MSG(pid > 0, in ATF_TC_BODY()
73 ATF_CHECK_EQ_MSG(pid, waitpid(pid, &wstatus, 0), in ATF_TC_BODY()
91 pid_t pid; in ATF_TC_BODY() local
94 pid = fork(); in ATF_TC_BODY()
95 if (pid == 0) { in ATF_TC_BODY()
99 ATF_REQUIRE_MSG(pid > 0, in ATF_TC_BODY()
101 ATF_CHECK_EQ_MSG(pid, waitpid(pid, &wstatus, 0), in ATF_TC_BODY()
[all …]
/freebsd/usr.bin/proccontrol/
H A Dproccontrol.c86 warnx("non-numeric pid"); in str2pid()
97 "(-p pid | command)\n"); in usage()
98 fprintf(stderr, " proccontrol -m mode -q [-p pid]\n"); in usage()
110 pid_t pid; in main() local
115 pid = -1; in main()
140 pid = str2pid(optarg); in main()
155 if (pid != -1 || query) in main()
157 pid = getpid(); in main()
158 } else if (pid == -1) { in main()
161 pid = getpid(); in main()
[all …]
/freebsd/lib/libsys/
H A Dsched_setparam.237 .Fn sched_setparam "pid_t pid" "const struct sched_param *param"
39 .Fn sched_getparam "pid_t pid" "struct sched_param *param"
44 .Fa pid
55 .Fa pid .
59 .Fa pid
63 .Fa pid
66 .Fa pid .
69 .Fa pid
82 .Fa pid
86 .Fa pid
[all …]
/freebsd/lib/libutil++/
H A Dfreebsd__pidfile.312 .Nd own a PID file handle
43 Each instance of this class owns a PID file handle created by
53 The currently-owned PID file is removed by invoking
56 The currently-owned PID file is also removed if it is replaced by the
62 method relinquishes ownership of the current PID file handle and returns the
63 value of the previously-owned PID file handle.
67 method writes out the PID of the current process to the PID file via
72 method closes the current PID file without removing it via
74 If the close succeeds, the PID file handle is no longer valid.
78 method returns the underlying file descriptor for the current PID file via
[all …]

12345678910>>...86