summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-03-23 07:12:41 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-03-23 07:12:41 +0000
commit199f21ec720a95a4866dc7ffe0dedd7857b3eae8 (patch)
treed7cb4bebd5adc67860c6a42e79a57ccc549dfb61
parenta43d92eade7bbe59e89dc6c8fbc448a77b3a1068 (diff)
Emulated version of SunOS ostime(2) wass totally wrong. For now
we will just return EPERM. Correct code is #if 0'd out as it needs to call settime() which is static to kern_time.c (and it's not clear that we really want to be setting the clock from an emulated program anyway).
-rw-r--r--sys/compat/sunos/sunos_misc.c26
-rw-r--r--sys/compat/sunos/syscalls.master4
2 files changed, 21 insertions, 9 deletions
diff --git a/sys/compat/sunos/sunos_misc.c b/sys/compat/sunos/sunos_misc.c
index 6352a122b4a..8d1cfb82e8c 100644
--- a/sys/compat/sunos/sunos_misc.c
+++ b/sys/compat/sunos/sunos_misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sunos_misc.c,v 1.19 1998/03/23 06:54:10 millert Exp $ */
+/* $OpenBSD: sunos_misc.c,v 1.20 1998/03/23 07:12:39 millert Exp $ */
/* $NetBSD: sunos_misc.c,v 1.65 1996/04/22 01:44:31 christos Exp $ */
/*
@@ -1207,19 +1207,31 @@ sunos_sys_sigvec(p, v, retval)
}
int
-sunos_sys_stime(p, v, retval)
+sunos_sys_ostime(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
- struct sunos_sys_stime_args /* {
- time_t *tp;
+ /*
+ * XXX - settime() is private to kern_time.c so we just lie.
+ */
+#if 0
+ struct sunos_sys_ostime_args /* {
+ syscallarg(int) time;
} */ *uap = v;
struct timeval tv;
+ int error;
- *retval = 0;
- microtime(&tv);
- return copyout(&tv.tv_sec, SCARG(uap, tp), sizeof(*(SCARG(uap, tp))));
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ return (error);
+
+ tv.tv_sec = SCARG(uap, time);
+ tv.tv_usec = 0;
+ settime(&tv);
+ return(0);
+#else
+ return(EPERM);
+#endif
}
/*
diff --git a/sys/compat/sunos/syscalls.master b/sys/compat/sunos/syscalls.master
index ec1d1e95a59..f4e9b956a64 100644
--- a/sys/compat/sunos/syscalls.master
+++ b/sys/compat/sunos/syscalls.master
@@ -1,4 +1,4 @@
- $OpenBSD: syscalls.master,v 1.9 1998/03/23 06:54:17 millert Exp $
+ $OpenBSD: syscalls.master,v 1.10 1998/03/23 07:12:40 millert Exp $
; $NetBSD: syscalls.master,v 1.33 1996/02/28 16:05:43 pk Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -68,7 +68,7 @@
22 UNIMPL System V umount
23 NOARGS { int sys_setuid(uid_t uid); }
24 NOARGS { uid_t sys_getuid(void); }
-25 STD { int sunos_sys_stime(time_t *tp); }
+25 STD { int sunos_sys_ostime(int time); }
26 STD { long sunos_sys_ptrace(int req, pid_t pid, \
caddr_t addr, int data, char *addr2); }
27 UNIMPL sunos_alarm