- implement SGI_GETSID command for syssgi()

- reworked SGI_GETPGID implementation to use the getpgid() system call instead
  of duplicating it.
This commit is contained in:
manu 2002-02-17 20:44:17 +00:00
parent b08c6b723c
commit 853adfc30b
1 changed files with 16 additions and 15 deletions

View File

@ -1,7 +1,7 @@
/* $NetBSD: irix_syssgi.c,v 1.15 2002/02/03 17:28:19 manu Exp $ */ /* $NetBSD: irix_syssgi.c,v 1.16 2002/02/17 20:44:17 manu Exp $ */
/*- /*-
* Copyright (c) 2001 The NetBSD Foundation, Inc. * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
* All rights reserved. * All rights reserved.
* *
* This code is derived from software contributed to The NetBSD Foundation * This code is derived from software contributed to The NetBSD Foundation
@ -37,7 +37,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: irix_syssgi.c,v 1.15 2002/02/03 17:28:19 manu Exp $"); __KERNEL_RCSID(0, "$NetBSD: irix_syssgi.c,v 1.16 2002/02/17 20:44:17 manu Exp $");
#include "opt_ddb.h" #include "opt_ddb.h"
@ -61,6 +61,8 @@ __KERNEL_RCSID(0, "$NetBSD: irix_syssgi.c,v 1.15 2002/02/03 17:28:19 manu Exp $"
#include <sys/sysctl.h> #include <sys/sysctl.h>
#include <sys/exec.h> #include <sys/exec.h>
#include <sys/exec_elf.h> #include <sys/exec_elf.h>
#include <sys/mount.h>
#include <sys/syscallargs.h>
#include <uvm/uvm_extern.h> #include <uvm/uvm_extern.h>
@ -105,21 +107,20 @@ irix_sys_syssgi(p, v, retval)
*retval = (register_t)hostid; *retval = (register_t)hostid;
break; break;
case IRIX_SGI_GETPGID: { /* Get parent process GID */ case IRIX_SGI_GETSID: { /* Get session ID: getsid(2) */
struct proc *tp; struct sys_getsid_args cup;
arg1 = SCARG(uap, arg1); /* Process group GID */ SCARG(&cup, pid) = (pid_t)SCARG(uap, arg1);
if (arg1 == 0) return (sys_getsid(p, &cup, retval));
tp = p; break;
else }
tp = pfind((pid_t)arg1);
if (tp == NULL || tp->p_pgrp == NULL) case IRIX_SGI_GETPGID: {/* Get parent process GID: getpgid(2) */
return 0; struct sys_getpgid_args cup;
*retval = (register_t)tp->p_pgid; SCARG(&cup, pid) = (pid_t)SCARG(uap, arg1);
return (sys_getpgid(p, &cup, retval));
return 0; break;
} }
case IRIX_SGI_RDNAME: { /* Read Processes' name */ case IRIX_SGI_RDNAME: { /* Read Processes' name */