From adb88e773b3897fa222b5d1bb8e46b2d6b424214 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 8 Sep 2012 00:33:04 -0400 Subject: add fallocate (nonstandardized) function this is equivalent to posix_fallocate except that it has an extra mode/flags argument to control its behavior, and stores the error in errno rather than returning an error code. --- src/fcntl/fallocate.c | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/fcntl/fallocate.c (limited to 'src/fcntl') diff --git a/src/fcntl/fallocate.c b/src/fcntl/fallocate.c new file mode 100644 index 00000000..9146350e --- /dev/null +++ b/src/fcntl/fallocate.c @@ -0,0 +1,9 @@ +#define _GNU_SOURCE +#include +#include "syscall.h" + +int fallocate(int fd, int mode, off_t base, off_t len) +{ + return syscall(SYS_fallocate, fd, mode, __SYSCALL_LL_E(base), + __SYSCALL_LL_E(len)); +} -- cgit v1.2.1