From e588ddfaa79dea05ebd64a63e215695ff0600b21 Mon Sep 17 00:00:00 2001 From: kstailey Date: Fri, 28 Mar 1997 22:03:46 +0000 Subject: [PATCH] added 34 - nice --- sys/compat/svr4/svr4_misc.c | 25 ++++++++++++++++++++++++- sys/compat/svr4/svr4_syscall.h | 1 + sys/compat/svr4/svr4_syscallargs.h | 5 +++++ sys/compat/svr4/svr4_syscalls.c | 2 +- sys/compat/svr4/svr4_sysent.c | 4 ++-- sys/compat/svr4/syscalls.master | 4 ++-- 6 files changed, 35 insertions(+), 6 deletions(-) diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index 800cab4e53c..26ed549f208 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_misc.c,v 1.8 1997/02/13 19:45:19 niklas Exp $ */ +/* $OpenBSD: svr4_misc.c,v 1.9 1997/03/28 22:03:46 kstailey Exp $ */ /* $NetBSD: svr4_misc.c,v 1.42 1996/12/06 03:22:34 christos Exp $ */ /* @@ -1292,3 +1292,26 @@ svr4_sys_memcntl(p, v, retval) /* XXX: no locking, invalidating, or syncing supported */ return sys_mprotect(p, &ap, retval); } + +int +svr4_sys_nice(p, v, retval) + register struct proc *p; + void *v; + register_t *retval; +{ + struct svr4_sys_nice_args *uap = v; + struct sys_setpriority_args ap; + int error; + + SCARG(&ap, which) = PRIO_PROCESS; + SCARG(&ap, who) = 0; + SCARG(&ap, prio) = SCARG(uap, prio); + + if ((error = sys_setpriority(p, &ap, retval)) != 0) + return error; + + if ((error = sys_getpriority(p, &ap, retval)) != 0) + return error; + + return 0; +} diff --git a/sys/compat/svr4/svr4_syscall.h b/sys/compat/svr4/svr4_syscall.h index 4a3f8b05a14..b9d262c9abf 100644 --- a/sys/compat/svr4/svr4_syscall.h +++ b/sys/compat/svr4/svr4_syscall.h @@ -33,6 +33,7 @@ #define SVR4_SYS_pause 29 #define SVR4_SYS_utime 30 #define SVR4_SYS_access 33 +#define SVR4_SYS_nice 34 #define SVR4_SYS_sync 36 #define SVR4_SYS_kill 37 #define SVR4_SYS_pgrpsys 39 diff --git a/sys/compat/svr4/svr4_syscallargs.h b/sys/compat/svr4/svr4_syscallargs.h index 3bf4ec44f4d..94f08b4424a 100644 --- a/sys/compat/svr4/svr4_syscallargs.h +++ b/sys/compat/svr4/svr4_syscallargs.h @@ -65,6 +65,10 @@ struct svr4_sys_access_args { syscallarg(int) flags; }; +struct svr4_sys_nice_args { + syscallarg(int) prio; +}; + struct svr4_sys_kill_args { syscallarg(int) pid; syscallarg(int) signum; @@ -361,6 +365,7 @@ int svr4_sys_fstat __P((struct proc *, void *, register_t *)); int svr4_sys_pause __P((struct proc *, void *, register_t *)); int svr4_sys_utime __P((struct proc *, void *, register_t *)); int svr4_sys_access __P((struct proc *, void *, register_t *)); +int svr4_sys_nice __P((struct proc *, void *, register_t *)); int sys_sync __P((struct proc *, void *, register_t *)); int svr4_sys_kill __P((struct proc *, void *, register_t *)); int svr4_sys_pgrpsys __P((struct proc *, void *, register_t *)); diff --git a/sys/compat/svr4/svr4_syscalls.c b/sys/compat/svr4/svr4_syscalls.c index bf9750b2f1a..a9e9248ee99 100644 --- a/sys/compat/svr4/svr4_syscalls.c +++ b/sys/compat/svr4/svr4_syscalls.c @@ -40,7 +40,7 @@ char *svr4_syscallnames[] = { "#31 (unimplemented was stty)", /* 31 = unimplemented was stty */ "#32 (unimplemented was gtty)", /* 32 = unimplemented was gtty */ "access", /* 33 = access */ - "#34 (unimplemented nice)", /* 34 = unimplemented nice */ + "nice", /* 34 = nice */ "#35 (unimplemented statfs)", /* 35 = unimplemented statfs */ "sync", /* 36 = sync */ "kill", /* 37 = kill */ diff --git a/sys/compat/svr4/svr4_sysent.c b/sys/compat/svr4/svr4_sysent.c index 066ddc971da..d1b0713ff1b 100644 --- a/sys/compat/svr4/svr4_sysent.c +++ b/sys/compat/svr4/svr4_sysent.c @@ -107,8 +107,8 @@ struct sysent svr4_sysent[] = { sys_nosys }, /* 32 = unimplemented was gtty */ { 2, s(struct svr4_sys_access_args), svr4_sys_access }, /* 33 = access */ - { 0, 0, - sys_nosys }, /* 34 = unimplemented nice */ + { 1, s(struct svr4_sys_nice_args), + svr4_sys_nice }, /* 34 = nice */ { 0, 0, sys_nosys }, /* 35 = unimplemented statfs */ { 0, 0, diff --git a/sys/compat/svr4/syscalls.master b/sys/compat/svr4/syscalls.master index 1d1d2cb8ca3..58184f794ae 100644 --- a/sys/compat/svr4/syscalls.master +++ b/sys/compat/svr4/syscalls.master @@ -1,4 +1,4 @@ - $OpenBSD: syscalls.master,v 1.11 1997/02/13 19:45:27 niklas Exp $ + $OpenBSD: syscalls.master,v 1.12 1997/03/28 22:03:49 kstailey Exp $ ; $NetBSD: syscalls.master,v 1.17 1996/02/10 17:12:51 christos Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -82,7 +82,7 @@ 31 UNIMPL was stty 32 UNIMPL was gtty 33 STD { int svr4_sys_access(char *path, int flags); } -34 UNIMPL nice +34 STD { int svr4_sys_nice(int prio); } 35 UNIMPL statfs 36 NOARGS { int sys_sync(void); } 37 STD { int svr4_sys_kill(int pid, int signum); } -- 2.20.1