summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Irofti <pirofti@cvs.openbsd.org>2012-05-23 19:47:03 +0000
committerPaul Irofti <pirofti@cvs.openbsd.org>2012-05-23 19:47:03 +0000
commit6eb1e750fbb07117a22d5663f95b427c9abd2fb9 (patch)
treebb9d57ccd741ddc90c81a76add2b59fe12231547
parent298f5ad9040c0b93ccd39f1e110caab2684070a4 (diff)
Add emulation support for fstatfs64.
Okay matthew@.
-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