summaryrefslogtreecommitdiff
path: root/sys/kern
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/kern
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/kern')
-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
6 files changed, 15 insertions, 15 deletions
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)