summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_misc.c
diff options
context:
space:
mode:
authoraaron <aaron@openbsd.org>1999-12-06 19:36:41 +0000
committeraaron <aaron@openbsd.org>1999-12-06 19:36:41 +0000
commit3b64c0d65d4df58a44bc970ef2655f3c2c9ed27d (patch)
treeb1a10df0c495cf5ac67feea741411d0feaeb44d7 /sys/compat/linux/linux_misc.c
parentsay how long the buffer needs to be (diff)
downloadwireguard-openbsd-3b64c0d65d4df58a44bc970ef2655f3c2c9ed27d.tar.xz
wireguard-openbsd-3b64c0d65d4df58a44bc970ef2655f3c2c9ed27d.zip
Implement compatibility for Linux stime() syscall.
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
-rw-r--r--sys/compat/linux/linux_misc.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 97ebc30aed5..599be904272 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_misc.c,v 1.24 1999/06/14 06:47:54 deraadt Exp $ */
+/* $OpenBSD: linux_misc.c,v 1.25 1999/12/06 19:36:41 aaron Exp $ */
/* $NetBSD: linux_misc.c,v 1.27 1996/05/20 01:59:21 fvdl Exp $ */
/*
@@ -1255,3 +1255,30 @@ linux_sys_nice(p, v, retval)
SCARG(&bsa, prio) = SCARG(uap, incr);
return sys_setpriority(p, &bsa, retval);
}
+
+int
+linux_sys_stime(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct linux_sys_time_args /* {
+ linux_time_t *t;
+ } */ *uap = v;
+ struct timeval atv;
+ linux_time_t tt;
+ int error;
+
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ return (error);
+
+ if ((error = copyin(SCARG(uap, t), &tt, sizeof(tt))) != 0)
+ return (error);
+
+ atv.tv_sec = tt;
+ atv.tv_usec = 0;
+
+ settime(&atv);
+
+ return 0;
+}