genfio: Splitting gen_template in 2 parts
[fio.git] / helpers.c
CommitLineData
ed80ddf6 1#include <stdlib.h>
f166280e 2#include <errno.h>
c5c8bd5c 3#include <sys/socket.h>
f8ed6d89 4#include <sys/time.h>
c5c8bd5c 5#include <netinet/in.h>
285d451f 6#include <unistd.h>
ed80ddf6
JA
7
8#include "compiler/compiler.h"
6fe1c1dc 9#include "arch/arch.h"
d09913c2 10#include "os/os.h"
ed80ddf6 11
67bf9823
JA
12#ifndef CONFIG_LINUX_FALLOCATE
13int fallocate(int fd, int mode, off_t offset, off_t len)
804bb9a1
JA
14{
15 errno = ENOSYS;
16 return -1;
17}
bcb01f84 18#endif
804bb9a1 19
67bf9823
JA
20#ifndef CONFIG_POSIX_FALLOCATE
21int posix_fallocate(int fd, off_t offset, off_t len)
ed80ddf6
JA
22{
23 return 0;
24}
285d451f 25#endif
c5c8bd5c 26
67bf9823
JA
27#ifndef CONFIG_SYNC_FILE_RANGE
28int sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags)
a54cf034 29{
285d451f
JA
30 errno = ENOSYS;
31 return -1;
a54cf034 32}
285d451f 33#endif
09164e5a 34
4b20c681 35#ifndef CONFIG_POSIX_FADVISE
67bf9823 36int posix_fadvise(int fd, off_t offset, off_t len, int advice)
09164e5a
JA
37{
38 return 0;
39}
40#endif