aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1997-08-19 06:00:27 +0000
committerPeter Wemm <peter@FreeBSD.org>1997-08-19 06:00:27 +0000
commit1a5018a043664a50368976703d0429eada5bb0f2 (patch)
tree52f1982121f6533b4ad97196be059205b4b81f4f /sys
parent217cb20cdc42955bffdd7a6fbde4790d003c24a7 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_prot.c51
1 files changed, 50 insertions, 1 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index 7843b7a8aba5..3db74aab5000 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_prot.c 8.6 (Berkeley) 1/21/94
- * $Id: kern_prot.c,v 1.32 1997/04/02 17:05:49 peter Exp $
+ * $Id: kern_prot.c,v 1.33 1997/08/02 14:31:34 bde Exp $
*/
/*
@@ -107,6 +107,55 @@ getpgrp(p, uap, retval)
return (0);
}
+/* Get an arbitary pid's process group id */
+#ifndef _SYS_SYSPROTO_H_
+struct getpgid_args {
+ pid_t pid;
+};
+#endif
+
+int
+getpgid(p, uap, retval)
+ struct proc *p;
+ struct getpgid_args *uap;
+ int *retval;
+{
+ if (uap->pid == 0)
+ goto found;
+
+ if ((p == pfind(uap->pid)) == 0)
+ return ESRCH;
+found:
+ *retval = p->p_pgrp->pg_id;
+ return 0;
+}
+
+/*
+ * Get an arbitary pid's session id.
+ */
+#ifndef _SYS_SYSPROTO_H_
+struct getsid_args {
+ pid_t pid;
+};
+#endif
+
+int
+getsid(p, uap, retval)
+ struct proc *p;
+ struct getsid_args *uap;
+ int *retval;
+{
+ if (uap->pid == 0)
+ goto found;
+
+ if ((p == pfind(uap->pid)) == 0)
+ return ESRCH;
+found:
+ *retval = p->p_pgrp->pg_session->s_leader->p_pid;
+ return 0;
+}
+
+
#ifndef _SYS_SYSPROTO_H_
struct getuid_args {
int dummy;