summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux
diff options
context:
space:
mode:
authorpirofti <pirofti@openbsd.org>2012-05-23 19:47:02 +0000
committerpirofti <pirofti@openbsd.org>2012-05-23 19:47:02 +0000
commitb6b04236426a20ec1ebf1cb239c35ef44f264a69 (patch)
treed66c555e54d81f6ac6783f10e4d2edfb0d05fa63 /sys/compat/linux
parentMake the "default" string a valid device name that has the same effect (diff)
downloadwireguard-openbsd-b6b04236426a20ec1ebf1cb239c35ef44f264a69.tar.xz
wireguard-openbsd-b6b04236426a20ec1ebf1cb239c35ef44f264a69.zip
Add emulation support for fstatfs64.
Okay matthew@.
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/linux_misc.c31
-rw-r--r--sys/compat/linux/syscalls.master5
2 files changed, 33 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 84a3b452136..a8f59a41494 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.77 2012/05/23 11:08:57 pirofti Exp $ */
+/* $OpenBSD: linux_misc.c,v 1.78 2012/05/23 19:47:02 pirofti Exp $ */
/* $NetBSD: linux_misc.c,v 1.27 1996/05/20 01:59:21 fvdl Exp $ */
/*-
@@ -554,6 +554,35 @@ linux_sys_fstatfs(p, v, retval)
return copyout((caddr_t) &ltmp, (caddr_t) SCARG(uap, sp), sizeof ltmp);
}
+int
+linux_sys_fstatfs64(struct proc *p, void *v, register_t *retval)
+{
+ struct linux_sys_fstatfs64_args /* {
+ syscallarg(int) fd;
+ syscallarg(struct linux_statfs64 *) sp;
+ } */ *uap = v;
+ struct statfs btmp, *bsp;
+ struct linux_statfs64 ltmp;
+ struct sys_fstatfs_args bsa;
+ caddr_t sg;
+ int error;
+
+ sg = stackgap_init(p->p_emul);
+ bsp = (struct statfs *) stackgap_alloc(&sg, sizeof (struct statfs));
+
+ SCARG(&bsa, fd) = SCARG(uap, fd);
+ SCARG(&bsa, buf) = bsp;
+
+ if ((error = sys_fstatfs(p, &bsa, retval)))
+ return error;
+
+ if ((error = copyin((caddr_t) bsp, (caddr_t) &btmp, sizeof btmp)))
+ return error;
+
+ bsd_to_linux_statfs64(&btmp, &ltmp);
+
+ return copyout((caddr_t) &ltmp, (caddr_t) SCARG(uap, sp), sizeof ltmp);
+}
/*
* uname(). Just copy the info from the various strings stored in the
* kernel, and put it in the Linux utsname structure. That structure
diff --git a/sys/compat/linux/syscalls.master b/sys/compat/linux/syscalls.master
index 38945b4e0e7..5a7e44531ed 100644
--- a/sys/compat/linux/syscalls.master
+++ b/sys/compat/linux/syscalls.master
@@ -1,4 +1,4 @@
- $OpenBSD: syscalls.master,v 1.67 2012/05/23 11:08:57 pirofti Exp $
+ $OpenBSD: syscalls.master,v 1.68 2012/05/23 19:47:02 pirofti Exp $
; $NetBSD: syscalls.master,v 1.15 1995/12/18 14:35:10 fvdl Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -418,7 +418,8 @@
267 UNIMPL linux_sys_clock_nanosleep
268 STD { int linux_sys_statfs64(char *path, \
struct linux_statfs64 *sp); }
-269 UNIMPL linux_sys_fstatfs64
+269 STD { int linux_sys_fstatfs64(int fd, \
+ struct linux_statfs64 *sp); }
270 UNIMPL linux_sys_tgkill
271 UNIMPL linux_sys_utimes
272 UNIMPL linux_sys_fadvise64_64