summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_file.c
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2015-05-24 17:33:21 +0000
committerdchagin <dchagin@FreeBSD.org>2015-05-24 17:33:21 +0000
commita346bc7dc8c84106dc867e69b02d981c56d6e3c7 (patch)
treed6fd86f28e469f1a7ed012ac9368ac0c6b11b3f5 /sys/compat/linux/linux_file.c
parent34bea3bccb08b259fbdbb53516b7529c0267640c (diff)
downloadFreeBSD-src-a346bc7dc8c84106dc867e69b02d981c56d6e3c7.zip
FreeBSD-src-a346bc7dc8c84106dc867e69b02d981c56d6e3c7.tar.gz
Add preliminary fallocate system call implementation
to emulate posix_fallocate() function. Differential Revision: https://reviews.freebsd.org/D1523 Reviewed by: emaste
Diffstat (limited to 'sys/compat/linux/linux_file.c')
-rw-r--r--sys/compat/linux/linux_file.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index b2cc8d2..9251a20 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -1636,3 +1636,18 @@ linux_dup3(struct thread *td, struct linux_dup3_args *args)
newfd = args->newfd;
return (kern_fcntl(td, args->oldfd, cmd, newfd));
}
+
+int
+linux_fallocate(struct thread *td, struct linux_fallocate_args *args)
+{
+
+ /*
+ * We emulate only posix_fallocate system call for which
+ * mode should be 0.
+ */
+ if (args->mode != 0)
+ return (ENOSYS);
+
+ return (kern_posix_fallocate(td, args->fd, args->offset,
+ args->len));
+}
OpenPOWER on IntegriCloud