Home
last modified time | relevance | path

Searched +full:- +full:- +full:pid (Results 1 – 25 of 1070) sorted by relevance

12345678910>>...43

/freebsd/usr.sbin/daemon/tests/
H A Ddaemon_test.sh3 # SPDX-License-Identifier: BSD-2-Clause
30 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`
43 if [ -f sleep_pid ]; then
[all …]
/freebsd/usr.bin/renice/tests/
H A Drenice_test.sh2 # Copyright (c) 2022-2023 Klara, Inc.
4 # SPDX-License-Identifier: BSD-2-Clause
7 # Name of user to use for -u tests when running as root. Beware that
12 atf_check -o empty -e ignore -s exit:0 renice "$@"
16 local pid=$1
18 local actual="$(ps -o nice= -p $pid)"
19 atf_check test "$actual" -eq "$expected"
27 local pid nice incr
29 pid=$!
30 nice="$(ps -o nice= -p $pid)"
[all …]
/freebsd/contrib/netbsd-tests/bin/ps/
H A Dt_ps.sh43 # for regular expressions to match the text in left- or
44 # right-justified columns.
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'
102 # Convert a list of keywords like "pid comm" to a regexp
103 # like " *PID COMMAND *"
[all …]
/freebsd/bin/pkill/tests/
H A Dpkill-j_test.sh6 jls -j "$check_name" -s | tr ' ' '\n' | grep jid= | sed -e 's/.*=//g'
11 if [ "$(id -u)" -ne 0 ]; then
19 ln -sf /bin/sleep $sleep
21 name="pkill -j <jid>"
23 jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \
24 command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount &
26 jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \
27 command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount &
36 [0-9]*,[0-9]*)
47 if pkill -f -j "$jid" $sleep && sleep 0.5 &&
[all …]
H A Dpgrep-j_test.sh6 jls -j "$check_name" -s | tr ' ' '\n' | grep jid= | sed -e 's/.*=//g'
11 if [ "$(id -u)" -ne 0 ]; then
19 ln -sf /bin/sleep $sleep
21 name="pgrep -j <jid>"
23 jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \
24 command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount &
26 jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \
27 command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount &
35 [0-9]*,[0-9]*)
43 pid1="$(pgrep -f -x -j "$jid" "$sleep $sleep_amount" | sort)"
[all …]
/freebsd/tests/sys/audit/
H A Dprocess-control.c1 /*-
40 #include <atf-c.h>
51 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()
[all …]
H A Dadministrative.c1 /*-
39 #include <atf-c.h>
48 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()
105 tp.tv_sec = -1; in ATF_TC_BODY()
107 ATF_REQUIRE_EQ(-1, settimeofday(&tp, &tzp)); in ATF_TC_BODY()
126 pid = getpid(); in ATF_TC_BODY()
[all …]
/freebsd/tools/test/ptrace/
H A Dscescx.c1 /*-
109 flags = lwpinfo->pl_flags; in decode_pl_flags()
137 switch (lwpinfo->pl_event) { in decode_pl_event()
150 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
[all …]
/freebsd/share/man/man4/
H A Ddtrace_pid.44 .\" SPDX-License-Identifier: BSD-2-Clause
13 .Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry
16 .Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&: Ns No \&[ Ns Ar offset …
17 .Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return
20 .Nm pid
28 .Nm pid
30 .Bl -inset
31 .It Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:entry
34 .It Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&: Ns Op Ar offset
40 .It Nm pid Ns Ar PID Ns Cm \&: Ns Ar module Ns Cm \&: Ns Ar function Ns Cm \&:return
[all …]
/freebsd/contrib/bsnmp/snmpd/
H A Dsnmpd.sh3 # Copyright (c) 2001-2003
35 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
[all …]
/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/
H A Dtst.chasestrings.ksh24 echo expected one argument: '<'dtrace-path'>'
32 elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf'
33 if [[ $? -ne 0 ]]; then
39 pid=$!
41 $dtrace -qs /dev/stdin <<EOF
42 pid$pid::has_princess:entry
45 this->t = (pid$pid\`$t *)(copyin(arg0, sizeof (pid$pid\`$t)));
47 copyinstr((uintptr_t)this->t->zi_gamename), this->t->zi_ndungeons,
48 copyinstr((uintptr_t)this->t->zi_villain), this->t->zi_haszelda);
52 pid$pid::has_dungeons:entry
[all …]
H A Dtst.printtype.ksh23 echo expected one argument: '<'dtrace-path'>'
31 elfdump -c "./$exe" | grep -Fq 'sh_name: .SUNW_ctf'
32 if [[ $? -ne 0 ]]; then
38 pid=$!
40 $dtrace -qs /dev/stdin <<EOF
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
[all …]
/freebsd/contrib/netbsd-tests/lib/libc/sys/
H A Dt_wait.c3 /*-
50 #include <atf-c.h>
64 ATF_REQUIRE(wait6(P_ALL, 0, &st, 0, &wru, &si) == -1 in ATF_TC_BODY()
80 pid_t pid; in ATF_TC_BODY() local
82 switch (pid = fork()) { in ATF_TC_BODY()
83 case -1: 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
[all …]
/freebsd/contrib/capsicum-test/
H A Dprocdesc.cc21 #include "capsicum-test.h"
25 // see and reap any specific pid. Define this to nothing for platforms
30 //------------------------------------------------
38 pid_t pid = -1; in pdwait4_()
39 int rc = pdgetpid(pd, &pid); in pdwait4_()
44 return wait4(pid, status, options, ru); in pdwait4_()
49 fprintf(f, " User CPU time=%ld.%06ld\n", (long)ru->ru_utime.tv_sec, (long)ru->ru_utime.tv_usec); in print_rusage()
50 …fprintf(f, " System CPU time=%ld.%06ld\n", (long)ru->ru_stime.tv_sec, (long)ru->ru_stime.tv_usec); in print_rusage()
51 fprintf(f, " Max RSS=%ld\n", ru->ru_maxrss); in print_rusage()
62 (long)stat->st_dev, (long)stat->st_ino, stat->st_mode, in print_stat()
[all …]
/freebsd/contrib/bmake/unit-tests/
H A Dopt-debug-jobs.exp1 job_pipe -1 -1, maxjobs 1, tokens 1, compat 0
2 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.exp1 job_pipe -1 -1, maxjobs 1, tokens 1, compat 0
2 TokenPool_Take: pid <pid>, aborting NONE, running 0
3 TokenPool_Take: pid <pid> took a token
14 set -e
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/sys/compat/linux/
H A Dlinux_ptrace.c1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
7 * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
122 linux_ptrace_status(struct thread *td, pid_t pid, int status) in linux_ptrace_status() argument
129 saved_retval = td->td_retval[0]; in linux_ptrace_status()
130 error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); in linux_ptrace_status()
131 td->td_retval[0] = saved_retval; in linux_ptrace_status()
137 pem = pem_find(td->td_proc); in linux_ptrace_status()
141 if ((pem->ptrace_flags & LINUX_PTRACE_O_TRACESYSGOOD) && in linux_ptrace_status()
144 if ((pem->ptrace_flags & LINUX_PTRACE_O_TRACESYSGOOD) && in linux_ptrace_status()
[all …]
/freebsd/bin/pwait/
H A Dpwait.c1 /*-
2 * Copyright (c) 2004-2009, Jilles Tjoelker
51 struct pid { struct
52 RB_ENTRY(pid) entry;
53 pid_t pid; member
57 pidcmp(const struct pid *a, const struct pid *b) in pidcmp()
59 return (a->pid > b->pid ? 1 : a->pid < b->pid ? -1 : 0); in pidcmp()
62 RB_HEAD(pidtree, pid);
64 RB_GENERATE_STATIC(pidtree, pid, entry, pidcmp);
69 fprintf(stderr, "usage: pwait [-t timeout] [-opv] pid ...\n"); in usage()
[all …]
/freebsd/usr.sbin/autofs/
H A Dpopen.c2 * SPDX-License-Identifier: BSD-3-Clause
58 struct pid { struct
59 SLIST_ENTRY(pid) next;
61 pid_t pid; argument
64 static SLIST_HEAD(, pid) pidlist = SLIST_HEAD_INITIALIZER(pidlist); argument
71 * Error handling is built in - if it returns, then it succeeded.
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()
110 cur->command = checked_strdup(command); in auto_popen()
[all …]
/freebsd/contrib/netbsd-tests/lib/libutil/
H A Dt_pidfile.c63 #include <atf-c.h>
74 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()
96 if (access(path, R_OK) != -1) { in ensure_deleted()
110 pid_t pid; in run_child() local
[all …]
/freebsd/usr.bin/mail/
H A Dpopen.c1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
45 pid_t pid; member
51 pid_t pid; member
100 pid_t pid; in Popen() local
114 fd1 = -1; in Popen()
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()
152 if (fp_head->pipe) in close_all_files()
[all …]
/freebsd/tests/sys/kern/
H A Dreaper.c1 /*-
32 #include <atf-c.h>
45 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()
61 ATF_REQUIRE(child != -1); in ATF_TC_BODY()
66 if (grandchild == -1) in ATF_TC_BODY()
78 pid = waitpid(child, &status, 0); in ATF_TC_BODY()
79 ATF_REQUIRE_EQ(child, pid); in ATF_TC_BODY()
80 r = WIFEXITED(status) ? WEXITSTATUS(status) : -1; in ATF_TC_BODY()
[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
74 .St -p1003.1b-93
75 as a write-style operation.
[all …]
/freebsd/lib/libutil++/
H A Dfreebsd__pidfile.32 .\" SPDX-License-Identifier: BSD-2-Clause
12 .Nd own a PID file handle
20 .Bd -ragged -offset indent
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
[all …]

12345678910>>...43