From 0c1a0303ec067977c7ccb823a1df5265dd490260 Mon Sep 17 00:00:00 2001 From: christos Date: Fri, 30 Aug 1996 23:07:49 +0000 Subject: [PATCH] add obsolete stime(2) --- sys/compat/sunos/sunos_misc.c | 30 +++++++++++++++++++++++++++++- sys/compat/sunos/syscalls.master | 4 ++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/sys/compat/sunos/sunos_misc.c b/sys/compat/sunos/sunos_misc.c index 8cb0c98db464..1face508fad6 100644 --- a/sys/compat/sunos/sunos_misc.c +++ b/sys/compat/sunos/sunos_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunos_misc.c,v 1.69 1996/08/26 22:49:43 thorpej Exp $ */ +/* $NetBSD: sunos_misc.c,v 1.70 1996/08/30 23:07:51 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -102,6 +102,34 @@ static int sunstatfs __P((struct statfs *, caddr_t)); static void sunos_pollscan __P((struct proc *, struct sunos_pollfd *, int, register_t *)); + +int +sunos_sys_stime(p, v, retval) + struct proc *p; + void *v; + register_t *retval; +{ + struct sunos_sys_stime_args *uap = v; + struct sys_settimeofday_args ap; + caddr_t sg = stackgap_init(p->p_emul); + struct timeval tv; + int error; + + error = copyin(SCARG(uap, tp), &tv.tv_sec, sizeof(tv.tv_sec)); + if (error) + return error; + tv.tv_usec = 0; + + SCARG(&ap, tv) = stackgap_alloc(&sg, sizeof(struct timeval)); + SCARG(&ap, tzp) = NULL; + + error = copyout(&tv, SCARG(&ap, tv), sizeof(struct timeval)); + if (error) + return error; + + return sys_settimeofday(p, &ap, retval); +} + int sunos_sys_wait4(p, v, retval) struct proc *p; diff --git a/sys/compat/sunos/syscalls.master b/sys/compat/sunos/syscalls.master index adba1906b18f..04c9ce10d58e 100644 --- a/sys/compat/sunos/syscalls.master +++ b/sys/compat/sunos/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.35 1996/08/26 22:49:48 thorpej Exp $ + $NetBSD: syscalls.master,v 1.36 1996/08/30 23:07:49 christos Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -65,7 +65,7 @@ 22 UNIMPL System V umount 23 NOARGS { int sys_setuid(uid_t uid); } 24 NOARGS { uid_t sys_getuid(void); } -25 UNIMPL sunos_stime +25 STD { int sunos_sys_stime(time_t *tp); } 26 STD { long sunos_sys_ptrace(int req, pid_t pid, \ caddr_t addr, int data, char *addr2); } 27 UNIMPL sunos_alarm