summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_prot.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2005-12-03 18:09:08 +0000
committertedu <tedu@openbsd.org>2005-12-03 18:09:08 +0000
commit802bb6ac573f1028eee6b171a32fb0694b0dd4eb (patch)
treeb4db50a51cd532af700099fe1f12d327f0c7c31e /sys/kern/kern_prot.c
parentThe first thing done when XXX_scsi_cmd() returns TRY_AGAIN_LATER is (diff)
downloadwireguard-openbsd-802bb6ac573f1028eee6b171a32fb0694b0dd4eb.tar.xz
wireguard-openbsd-802bb6ac573f1028eee6b171a32fb0694b0dd4eb.zip
kernel support for threaded processes (rthreads).
uses rfork(RFTHREAD) to create threads, which are presently processes that are a little more tightly bound together. several new syscalls added to facilitate a userland thread library. all conditional on RTHREADS, currently disabled. ok deraadt
Diffstat (limited to 'sys/kern/kern_prot.c')
-rw-r--r--sys/kern/kern_prot.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index 58b32807097..f3081e33740 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_prot.c,v 1.27 2005/11/28 00:14:29 jsg Exp $ */
+/* $OpenBSD: kern_prot.c,v 1.28 2005/12/03 18:09:08 tedu Exp $ */
/* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */
/*
@@ -60,14 +60,28 @@ int
sys_getpid(struct proc *p, void *v, register_t *retval)
{
- *retval = p->p_pid;
+ *retval = p->p_thrparent->p_pid;
#if defined(COMPAT_43) || defined(COMPAT_SUNOS) || defined(COMPAT_IBCS2) || \
defined(COMPAT_FREEBSD) || defined(COMPAT_BSDOS)
- retval[1] = p->p_pptr->p_pid;
+ retval[1] = p->p_thrparent->p_pptr->p_pid;
#endif
return (0);
}
+#ifdef RTHREADS
+/* ARGSUSED */
+int
+sys_getthrid(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+
+ *retval = p->p_pid;
+ return (0);
+}
+#endif
+
/* ARGSUSED */
int
sys_getppid(struct proc *p, void *v, register_t *retval)