diff options
| author | 2012-05-23 19:47:02 +0000 | |
|---|---|---|
| committer | 2012-05-23 19:47:02 +0000 | |
| commit | b6b04236426a20ec1ebf1cb239c35ef44f264a69 (patch) | |
| tree | d66c555e54d81f6ac6783f10e4d2edfb0d05fa63 /sys/compat/linux/linux_misc.c | |
| parent | Make the "default" string a valid device name that has the same effect (diff) | |
| download | wireguard-openbsd-b6b04236426a20ec1ebf1cb239c35ef44f264a69.tar.xz wireguard-openbsd-b6b04236426a20ec1ebf1cb239c35ef44f264a69.zip | |
Add emulation support for fstatfs64.
Okay matthew@.
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
| -rw-r--r-- | sys/compat/linux/linux_misc.c | 31 |
1 files changed, 30 insertions, 1 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) <mp, (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, <mp); + + return copyout((caddr_t) <mp, (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 |
