summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_stats.c
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2016-03-20 13:21:20 +0000
committerdchagin <dchagin@FreeBSD.org>2016-03-20 13:21:20 +0000
commit6aee9bb2b457e5615395d8e3a5527d87e6fe441f (patch)
tree72f0f3b0305a0d70d52c33f5951a0b56738a2fc9 /sys/compat/linux/linux_stats.c
parent0fe879224d0f65dcaeef238ff8075b49a863b1f2 (diff)
downloadFreeBSD-src-6aee9bb2b457e5615395d8e3a5527d87e6fe441f.zip
FreeBSD-src-6aee9bb2b457e5615395d8e3a5527d87e6fe441f.tar.gz
Implement fstatfs64 system call.
PR: 181012 Submitted by: John Wehle MFC after: 1 week
Diffstat (limited to 'sys/compat/linux/linux_stats.c')
-rw-r--r--sys/compat/linux/linux_stats.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c
index 84ade7b..6adaba9 100644
--- a/sys/compat/linux/linux_stats.c
+++ b/sys/compat/linux/linux_stats.c
@@ -460,6 +460,27 @@ linux_statfs64(struct thread *td, struct linux_statfs64_args *args)
bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs);
return copyout(&linux_statfs, args->buf, sizeof(linux_statfs));
}
+
+int
+linux_fstatfs64(struct thread *td, struct linux_fstatfs64_args *args)
+{
+ struct l_statfs64 linux_statfs;
+ struct statfs bsd_statfs;
+ int error;
+
+#ifdef DEBUG
+ if (ldebug(fstatfs64))
+ printf(ARGS(fstatfs64, "%d, *"), args->fd);
+#endif
+ if (args->bufsize != sizeof(struct l_statfs64))
+ return (EINVAL);
+
+ error = kern_fstatfs(td, args->fd, &bsd_statfs);
+ if (error)
+ return error;
+ bsd_to_linux_statfs64(&bsd_statfs, &linux_statfs);
+ return (copyout(&linux_statfs, args->buf, sizeof(linux_statfs)));
+}
#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
int
OpenPOWER on IntegriCloud