summaryrefslogtreecommitdiff
path: root/sys
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
parent66e09276fdf6e1632a9bb937bbf5bd601731416b (diff)
add getpgid(2) from NetBSD
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/init_sysent.c4
-rw-r--r--sys/kern/kern_prot.c24
-rw-r--r--sys/kern/syscalls.c2
-rw-r--r--sys/kern/syscalls.master4
-rw-r--r--sys/sys/syscall.h1
-rw-r--r--sys/sys/syscallargs.h5
6 files changed, 34 insertions, 6 deletions
diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c
index 550a3a01517..6c687ec5e94 100644
--- a/sys/kern/init_sysent.c
+++ b/sys/kern/init_sysent.c
@@ -500,8 +500,8 @@ struct sysent sysent[] = {
sys_undelete }, /* 205 = undelete */
{ 2, s(struct sys_futimes_args),
sys_futimes }, /* 206 = futimes */
- { 0, 0,
- sys_nosys }, /* 207 = unimplemented */
+ { 1, s(struct sys_getpgid_args),
+ sys_getpgid }, /* 207 = getpgid */
{ 0, 0,
sys_nosys }, /* 208 = unimplemented */
{ 0, 0,
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)
diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c
index 5c0b661a307..a30bc955f75 100644
--- a/sys/kern/syscalls.c
+++ b/sys/kern/syscalls.c
@@ -253,7 +253,7 @@ char *syscallnames[] = {
"munlock", /* 204 = munlock */
"undelete", /* 205 = undelete */
"futimes", /* 206 = futimes */
- "#207 (unimplemented)", /* 207 = unimplemented */
+ "getpgid", /* 207 = getpgid */
"#208 (unimplemented)", /* 208 = unimplemented */
"#209 (unimplemented)", /* 209 = unimplemented */
#ifdef LKM
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index 4c0d4a2c79d..1830c1558ea 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -1,4 +1,4 @@
- $OpenBSD: syscalls.master,v 1.14 1997/04/20 20:48:27 tholo Exp $
+ $OpenBSD: syscalls.master,v 1.15 1997/05/30 21:43:33 kstailey Exp $
; $NetBSD: syscalls.master,v 1.32 1996/04/23 10:24:21 mycroft Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -365,7 +365,7 @@
204 STD { int sys_munlock(caddr_t addr, size_t len); }
205 STD { int sys_undelete(char *path); }
206 STD { int sys_futimes(int fd, struct timeval *tptr); }
-207 UNIMPL
+207 STD { int sys_getpgid(pid_t pid); }
208 UNIMPL
209 UNIMPL
;
diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h
index 005a8826a1d..870b341d97d 100644
--- a/sys/sys/syscall.h
+++ b/sys/sys/syscall.h
@@ -194,6 +194,7 @@
#define SYS_munlock 204
#define SYS_undelete 205
#define SYS_futimes 206
+#define SYS_getpgid 207
#define SYS___semctl 220
#define SYS_semget 221
#define SYS_semop 222
diff --git a/sys/sys/syscallargs.h b/sys/sys/syscallargs.h
index 0eb2922c74d..db970fc0454 100644
--- a/sys/sys/syscallargs.h
+++ b/sys/sys/syscallargs.h
@@ -882,6 +882,10 @@ struct sys_futimes_args {
syscallarg(struct timeval *) tptr;
};
+struct sys_getpgid_args {
+ syscallarg(pid_t) pid;
+};
+
struct sys___semctl_args {
syscallarg(int) semid;
syscallarg(int) semnum;
@@ -1206,6 +1210,7 @@ int sys_mlock __P((struct proc *, void *, register_t *));
int sys_munlock __P((struct proc *, void *, register_t *));
int sys_undelete __P((struct proc *, void *, register_t *));
int sys_futimes __P((struct proc *, void *, register_t *));
+int sys_getpgid __P((struct proc *, void *, register_t *));
#ifdef LKM
int sys_lkmnosys __P((struct proc *, void *, register_t *));
int sys_lkmnosys __P((struct proc *, void *, register_t *));