summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-01-24 00:58:56 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-01-24 00:58:56 +0000
commitd071f665295ee2ef0626072d8311e01b1102803f (patch)
treebe05cd1920cccda5749ebc349bb5d810c2dd42f6 /sys
parent0ec985aaf0fb250ec3531dee93ea4bb29038ed19 (diff)
Rename pfind(9) into tfind(9) to reflect that it deals with threads.
While here document prfind(9. with and ok guenther@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/db_trace.c4
-rw-r--r--sys/arch/arm/arm/db_trace.c4
-rw-r--r--sys/arch/i386/i386/db_trace.c4
-rw-r--r--sys/arch/powerpc/ddb/db_trace.c4
-rw-r--r--sys/arch/sparc64/sparc64/db_trace.c4
-rw-r--r--sys/kern/kern_fork.c4
-rw-r--r--sys/kern/kern_proc.c4
-rw-r--r--sys/kern/kern_sig.c4
-rw-r--r--sys/kern/kern_time.c6
-rw-r--r--sys/kern/sys_generic.c6
-rw-r--r--sys/kern/sys_process.c6
-rw-r--r--sys/sys/proc.h4
12 files changed, 27 insertions, 27 deletions
diff --git a/sys/arch/amd64/amd64/db_trace.c b/sys/arch/amd64/amd64/db_trace.c
index d8d297c7f78..3615b2c84df 100644
--- a/sys/arch/amd64/amd64/db_trace.c
+++ b/sys/arch/amd64/amd64/db_trace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_trace.c,v 1.23 2016/09/16 19:13:16 jasper Exp $ */
+/* $OpenBSD: db_trace.c,v 1.24 2017/01/24 00:58:55 mpi Exp $ */
/* $NetBSD: db_trace.c,v 1.1 2003/04/26 18:39:27 fvdl Exp $ */
/*
@@ -181,7 +181,7 @@ db_stack_trace_print(db_expr_t addr, boolean_t have_addr, db_expr_t count,
callpc = (db_addr_t)ddb_regs.tf_rip;
} else {
if (trace_proc) {
- struct proc *p = pfind((pid_t)addr);
+ struct proc *p = tfind((pid_t)addr);
if (p == NULL) {
(*pr) ("not found\n");
return;
diff --git a/sys/arch/arm/arm/db_trace.c b/sys/arch/arm/arm/db_trace.c
index 202fb08d0fd..59c2ed65dab 100644
--- a/sys/arch/arm/arm/db_trace.c
+++ b/sys/arch/arm/arm/db_trace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_trace.c,v 1.9 2016/09/20 08:35:25 jasper Exp $ */
+/* $OpenBSD: db_trace.c,v 1.10 2017/01/24 00:58:55 mpi Exp $ */
/* $NetBSD: db_trace.c,v 1.8 2003/01/17 22:28:48 thorpej Exp $ */
/*
@@ -104,7 +104,7 @@ db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
struct proc *p;
struct user *u;
(*pr) ("trace: pid %d ", (int)addr);
- p = pfind(addr);
+ p = tfind(addr);
if (p == NULL) {
(*pr)("not found\n");
return;
diff --git a/sys/arch/i386/i386/db_trace.c b/sys/arch/i386/i386/db_trace.c
index 87821c2e03a..0a49cdbae50 100644
--- a/sys/arch/i386/i386/db_trace.c
+++ b/sys/arch/i386/i386/db_trace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_trace.c,v 1.22 2016/09/18 13:38:01 jasper Exp $ */
+/* $OpenBSD: db_trace.c,v 1.23 2017/01/24 00:58:55 mpi Exp $ */
/* $NetBSD: db_trace.c,v 1.18 1996/05/03 19:42:01 christos Exp $ */
/*
@@ -195,7 +195,7 @@ db_stack_trace_print(db_expr_t addr, boolean_t have_addr, db_expr_t count,
} else if (trace_thread) {
(*pr) ("%s: can't trace thread\n", __func__);
} else if (trace_proc) {
- struct proc *p = pfind((pid_t)addr);
+ struct proc *p = tfind((pid_t)addr);
if (p == NULL) {
(*pr) ("not found\n");
return;
diff --git a/sys/arch/powerpc/ddb/db_trace.c b/sys/arch/powerpc/ddb/db_trace.c
index 21a19f75436..a8a1cd591a3 100644
--- a/sys/arch/powerpc/ddb/db_trace.c
+++ b/sys/arch/powerpc/ddb/db_trace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_trace.c,v 1.10 2016/09/10 06:36:26 jasper Exp $ */
+/* $OpenBSD: db_trace.c,v 1.11 2017/01/24 00:58:55 mpi Exp $ */
/* $NetBSD: db_trace.c,v 1.15 1996/02/22 23:23:41 gwr Exp $ */
/*
@@ -134,7 +134,7 @@ db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
lr = ddb_regs.srr0;
} else {
if (trace_proc) {
- struct proc *p = pfind((pid_t)addr);
+ struct proc *p = tfind((pid_t)addr);
if (p == NULL) {
(*pr) ("not found\n");
return;
diff --git a/sys/arch/sparc64/sparc64/db_trace.c b/sys/arch/sparc64/sparc64/db_trace.c
index 0aaaec3a3fc..aba94187a59 100644
--- a/sys/arch/sparc64/sparc64/db_trace.c
+++ b/sys/arch/sparc64/sparc64/db_trace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_trace.c,v 1.12 2016/09/11 03:14:04 guenther Exp $ */
+/* $OpenBSD: db_trace.c,v 1.13 2017/01/24 00:58:55 mpi Exp $ */
/* $NetBSD: db_trace.c,v 1.23 2001/07/10 06:06:16 eeh Exp $ */
/*
@@ -78,7 +78,7 @@ db_stack_trace_print(db_expr_t addr, int have_addr, db_expr_t count,
struct proc *p;
struct user *u;
(*pr)("trace: pid %d ", (int)addr);
- p = pfind(addr);
+ p = tfind(addr);
if (p == NULL) {
(*pr)("not found\n");
return;
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 9a82d5bbe56..3ff2085f732 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_fork.c,v 1.192 2016/11/07 00:26:32 guenther Exp $ */
+/* $OpenBSD: kern_fork.c,v 1.193 2017/01/24 00:58:55 mpi Exp $ */
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
/*
@@ -559,7 +559,7 @@ alloctid(void)
do {
/* (0 .. TID_MASK+1] */
tid = 1 + (arc4random() & TID_MASK);
- } while (pfind(tid) != NULL);
+ } while (tfind(tid) != NULL);
return (tid);
}
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index ddf08ab2f12..5154d57722c 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_proc.c,v 1.72 2017/01/21 05:42:03 guenther Exp $ */
+/* $OpenBSD: kern_proc.c,v 1.73 2017/01/24 00:58:55 mpi Exp $ */
/* $NetBSD: kern_proc.c,v 1.14 1996/02/09 18:59:41 christos Exp $ */
/*
@@ -169,7 +169,7 @@ inferior(struct process *pr, struct process *parent)
* Locate a proc (thread) by number
*/
struct proc *
-pfind(pid_t tid)
+tfind(pid_t tid)
{
struct proc *p;
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index b40eac85f90..e1b2113b197 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.207 2017/01/21 05:42:03 guenther Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.208 2017/01/24 00:58:55 mpi Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -617,7 +617,7 @@ sys_thrkill(struct proc *cp, void *v, register_t *retval)
if (((u_int)signum) >= NSIG)
return (EINVAL);
if (tid > THREAD_PID_OFFSET) {
- if ((p = pfind(tid - THREAD_PID_OFFSET)) == NULL)
+ if ((p = tfind(tid - THREAD_PID_OFFSET)) == NULL)
return (ESRCH);
/* can only kill threads in the same process */
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 64083f9ccde..8193c4eda43 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_time.c,v 1.98 2016/09/03 14:46:56 naddy Exp $ */
+/* $OpenBSD: kern_time.c,v 1.99 2017/01/24 00:58:55 mpi Exp $ */
/* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */
/*
@@ -141,7 +141,7 @@ clock_gettime(struct proc *p, clockid_t clock_id, struct timespec *tp)
default:
/* check for clock from pthread_getcpuclockid() */
if (__CLOCK_TYPE(clock_id) == CLOCK_THREAD_CPUTIME_ID) {
- q = pfind(__CLOCK_PTID(clock_id) - THREAD_PID_OFFSET);
+ q = tfind(__CLOCK_PTID(clock_id) - THREAD_PID_OFFSET);
if (q == NULL || q->p_p != p->p_p)
return (ESRCH);
*tp = q->p_tu.tu_runtime;
@@ -232,7 +232,7 @@ sys_clock_getres(struct proc *p, void *v, register_t *retval)
default:
/* check for clock from pthread_getcpuclockid() */
if (__CLOCK_TYPE(clock_id) == CLOCK_THREAD_CPUTIME_ID) {
- q = pfind(__CLOCK_PTID(clock_id) - THREAD_PID_OFFSET);
+ q = tfind(__CLOCK_PTID(clock_id) - THREAD_PID_OFFSET);
if (q == NULL || q->p_p != p->p_p)
return (ESRCH);
ts.tv_sec = 0;
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index cf08a3022be..b1d3f7b6951 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_generic.c,v 1.113 2016/11/07 00:26:33 guenther Exp $ */
+/* $OpenBSD: sys_generic.c,v 1.114 2017/01/24 00:58:55 mpi Exp $ */
/* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */
/*
@@ -783,7 +783,7 @@ selrecord(struct proc *selector, struct selinfo *sip)
mytid = selector->p_tid;
if (sip->si_seltid == mytid)
return;
- if (sip->si_seltid && (p = pfind(sip->si_seltid)) &&
+ if (sip->si_seltid && (p = tfind(sip->si_seltid)) &&
p->p_wchan == (caddr_t)&selwait)
sip->si_flags |= SI_COLL;
else
@@ -807,7 +807,7 @@ selwakeup(struct selinfo *sip)
sip->si_flags &= ~SI_COLL;
wakeup(&selwait);
}
- p = pfind(sip->si_seltid);
+ p = tfind(sip->si_seltid);
sip->si_seltid = 0;
if (p != NULL) {
SCHED_LOCK(s);
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 7c7b261cba3..90c67769caa 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_process.c,v 1.74 2016/11/07 00:26:33 guenther Exp $ */
+/* $OpenBSD: sys_process.c,v 1.75 2017/01/24 00:58:55 mpi Exp $ */
/* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */
/*-
@@ -156,7 +156,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval)
case PT_SETXMMREGS:
#endif
if (SCARG(uap, pid) > THREAD_PID_OFFSET) {
- t = pfind(SCARG(uap, pid) - THREAD_PID_OFFSET);
+ t = tfind(SCARG(uap, pid) - THREAD_PID_OFFSET);
if (t == NULL)
return (ESRCH);
tr = t->p_p;
@@ -316,7 +316,7 @@ sys_ptrace(struct proc *p, void *v, register_t *retval)
if (error)
return (error);
- t = pfind(pts.pts_tid - THREAD_PID_OFFSET);
+ t = tfind(pts.pts_tid - THREAD_PID_OFFSET);
if (t == NULL || ISSET(t->p_flag, P_WEXIT))
return (ESRCH);
if (t->p_p != tr)
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 66c6ff522a5..4aa3587f5f6 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.h,v 1.229 2017/01/21 05:42:03 guenther Exp $ */
+/* $OpenBSD: proc.h,v 1.230 2017/01/24 00:58:55 mpi Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
@@ -501,7 +501,7 @@ void freepid(pid_t);
struct process *prfind(pid_t); /* Find process by id. */
struct process *zombiefind(pid_t); /* Find zombie process by id. */
-struct proc *pfind(pid_t); /* Find thread by id. */
+struct proc *tfind(pid_t); /* Find thread by id. */
struct pgrp *pgfind(pid_t); /* Find process group by id. */
void proc_printit(struct proc *p, const char *modif,
int (*pr)(const char *, ...));