diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2010-01-28 19:59:12 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2010-01-28 19:59:12 +0000 |
commit | c056e054c99423a238ceb9726fd6fdfb41b3ca0e (patch) | |
tree | 1eacd56ca16e18c177161ca47fb454c762b2456c /sys/compat | |
parent | c8c4525ddb2c026993ac0bce3ef1651951330f8c (diff) |
HP-UX getpgrp2() is documented as returning the same value than getpgid(),
with the same error conditions. So reimplement it as the real thing.
ok guenther@
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/hpux/hppa/syscalls.master | 4 | ||||
-rw-r--r-- | sys/compat/hpux/hpux_compat.c | 33 | ||||
-rw-r--r-- | sys/compat/hpux/m68k/syscalls.master | 4 |
3 files changed, 5 insertions, 36 deletions
diff --git a/sys/compat/hpux/hppa/syscalls.master b/sys/compat/hpux/hppa/syscalls.master index c3d88a45d0a..c8299c9689e 100644 --- a/sys/compat/hpux/hppa/syscalls.master +++ b/sys/compat/hpux/hppa/syscalls.master @@ -1,4 +1,4 @@ - $OpenBSD: syscalls.master,v 1.8 2004/09/19 22:04:15 mickey Exp $ + $OpenBSD: syscalls.master,v 1.9 2010/01/28 19:59:09 miod Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -141,7 +141,7 @@ 78 UNIMPL 79 NOARGS { int sys_getgroups(u_int gidsetsize, gid_t *gidset); } 80 NOARGS { int sys_setgroups(u_int gidsetsize, gid_t *gidset); } -81 STD { int hpux_sys_getpgrp2(pid_t pid); } +81 NOARGS { pid_t sys_getpgid(pid_t pid); } 82 STD { int hpux_sys_setpgrp2(pid_t pid, pid_t pgid); } 83 NOARGS { int sys_setitimer(u_int which, \ struct itimerval *itv, struct itimerval *oitv); } diff --git a/sys/compat/hpux/hpux_compat.c b/sys/compat/hpux/hpux_compat.c index f8baad27585..3bc2a347a85 100644 --- a/sys/compat/hpux/hpux_compat.c +++ b/sys/compat/hpux/hpux_compat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hpux_compat.c,v 1.31 2010/01/28 19:23:06 guenther Exp $ */ +/* $OpenBSD: hpux_compat.c,v 1.32 2010/01/28 19:59:07 miod Exp $ */ /* $NetBSD: hpux_compat.c,v 1.35 1997/05/08 16:19:48 mycroft Exp $ */ /* @@ -948,37 +948,6 @@ out: /* hpux_sys_getcontext() is found in hpux_machdep.c */ /* - * This is the equivalent of BSD getpgrp but with more restrictions. - * XXX Need to verify the differences between this and sys_getpgid() - */ -int -hpux_sys_getpgrp2(cp, v, retval) - struct proc *cp; - void *v; - register_t *retval; -{ - struct hpux_sys_getpgrp2_args *uap = v; - struct proc *p; - - /* If zero, the call applies to the calling process */ - if (SCARG(uap, pid) == 0) - p = cp; - else - p = pfind(SCARG(uap, pid)); - if (p == NULL) - return (ESRCH); - /* Skip exiting processes. */ - if (p->p_pgrp->pg_session->s_leader == NULL) - return (ESRCH); - /* Both processes need to be in the same session. */ - if (cp != p && cp->p_pgrp->pg_session->s_leader->p_pid != - p->p_pgrp->pg_session->s_leader->p_pid) - return (EPERM); - *retval = p->p_pgid; - return (0); -} - -/* * This is the equivalent of BSD setpgrp but with more restrictions. * Note we do not check the real uid or "saved" uid or pgrp. */ diff --git a/sys/compat/hpux/m68k/syscalls.master b/sys/compat/hpux/m68k/syscalls.master index dc576ad1bbe..6f3fbf9cc96 100644 --- a/sys/compat/hpux/m68k/syscalls.master +++ b/sys/compat/hpux/m68k/syscalls.master @@ -1,4 +1,4 @@ - $OpenBSD: syscalls.master,v 1.1 2004/07/09 21:33:45 mickey Exp $ + $OpenBSD: syscalls.master,v 1.2 2010/01/28 19:59:11 miod Exp $ ; $NetBSD: syscalls.master,v 1.13 1997/03/16 03:48:04 thorpej Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -140,7 +140,7 @@ 78 UNIMPL 79 NOARGS { int sys_getgroups(u_int gidsetsize, gid_t *gidset); } 80 NOARGS { int sys_setgroups(u_int gidsetsize, gid_t *gidset); } -81 STD { int hpux_sys_getpgrp2(pid_t pid); } +81 NOARGS { pid_t sys_getpgid(pid_t pid); } 82 STD { int hpux_sys_setpgrp2(pid_t pid, pid_t pgid); } 83 NOARGS { int sys_setitimer(u_int which, \ struct itimerval *itv, struct itimerval *oitv); } |