summaryrefslogtreecommitdiff
path: root/sys/kern/kern_prot.c
diff options
context:
space:
mode:
authorkstailey <kstailey@cvs.openbsd.org>1997-05-30 21:43:36 +0000
committerkstailey <kstailey@cvs.openbsd.org>1997-05-30 21:43:36 +0000
commitafc36869f5ece6654bde1e92c0bd75a333d6ae17 (patch)
tree99594afa0aa95a907b63e17668ee00cc2a71932c /sys/kern/kern_prot.c
parent66e09276fdf6e1632a9bb937bbf5bd601731416b (diff)
add getpgid(2) from NetBSD
Diffstat (limited to 'sys/kern/kern_prot.c')
-rw-r--r--sys/kern/kern_prot.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index c7d18bf7ad8..0c3d62a4761 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_prot.c,v 1.8 1997/03/29 08:58:03 tholo Exp $ */
+/* $OpenBSD: kern_prot.c,v 1.9 1997/05/30 21:43:34 kstailey Exp $ */
/* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */
/*
@@ -97,6 +97,28 @@ sys_getpgrp(p, v, retval)
return (0);
}
+/*
+ * SysVR.4 compatible getpgid()
+ */
+int
+sys_getpgid(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ register struct sys_getpgid_args /* {
+ syscallarg(pid_t) pid;
+ } */ *uap = v;
+
+ if (SCARG(uap, pid) == 0)
+ goto found;
+ if ((p = pfind(SCARG(uap, pid))) == 0)
+ return (ESRCH);
+found:
+ *retval = p->p_pgid;
+ return 0;
+}
+
/* ARGSUSED */
int
sys_getuid(p, v, retval)