diff options
Diffstat (limited to 'libglusterfs/src/syscall.c')
-rw-r--r-- | libglusterfs/src/syscall.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libglusterfs/src/syscall.c b/libglusterfs/src/syscall.c index bb834dbfd9f..e8954cc237c 100644 --- a/libglusterfs/src/syscall.c +++ b/libglusterfs/src/syscall.c @@ -458,3 +458,26 @@ sys_access (const char *pathname, int mode) { return access (pathname, mode); } + + +int +sys_fallocate(int fd, int mode, off_t offset, off_t len) +{ +#ifdef HAVE_FALLOCATE + return fallocate(fd, mode, offset, len); +#endif + +#ifdef HAVE_POSIX_FALLOCATE + if (mode) { + /* keep size not supported */ + errno = EOPNOTSUPP; + return -1; + } + + return posix_fallocate(fd, offset, len); +#endif + + errno = ENOSYS; + return -1; +} + |