Merge branch 'github-issue-947' of https://github.com/vincentkfu/fio
[fio.git] / helpers.c
1 #include <errno.h>
2
3 #include "helpers.h"
4
5 #ifndef CONFIG_LINUX_FALLOCATE
6 int fallocate(int fd, int mode, off_t offset, off_t len)
7 {
8         errno = ENOSYS;
9         return -1;
10 }
11 #endif
12
13 #ifndef CONFIG_POSIX_FALLOCATE
14 int posix_fallocate(int fd, off_t offset, off_t len)
15 {
16         return 0;
17 }
18 #endif
19
20 #ifndef CONFIG_SYNC_FILE_RANGE
21 int sync_file_range(int fd, uint64_t offset, uint64_t nbytes,
22                     unsigned int flags)
23 {
24         errno = ENOSYS;
25         return -1;
26 }
27 #endif
28
29 #ifndef CONFIG_POSIX_FADVISE
30 int posix_fadvise(int fd, off_t offset, off_t len, int advice)
31 {
32         return 0;
33 }
34 #endif