Jens Axboe | ed80ddf | 2009-11-23 15:14:48 +0100 | [diff] [blame] | 1 | #include <stdlib.h> |
Jens Axboe | f166280 | 2009-11-24 08:48:21 +0100 | [diff] [blame] | 2 | #include <errno.h> |
Jens Axboe | c5c8bd5 | 2009-11-24 13:01:41 +0100 | [diff] [blame] | 3 | #include <sys/socket.h> |
Jens Axboe | f8ed6d8 | 2009-12-16 09:50:05 +0100 | [diff] [blame] | 4 | #include <sys/time.h> |
Jens Axboe | c5c8bd5 | 2009-11-24 13:01:41 +0100 | [diff] [blame] | 5 | #include <netinet/in.h> |
Jens Axboe | 285d451 | 2010-03-15 13:38:11 +0100 | [diff] [blame] | 6 | #include <unistd.h> |
Jens Axboe | ed80ddf | 2009-11-23 15:14:48 +0100 | [diff] [blame] | 7 | |
| 8 | #include "compiler/compiler.h" |
Joss Grossman | 6fe1c1d | 2010-09-30 10:51:42 +0900 | [diff] [blame] | 9 | #include "arch/arch.h" |
Jens Axboe | d09913c | 2009-12-16 19:23:10 +0100 | [diff] [blame] | 10 | #include "os/os.h" |
Jens Axboe | ed80ddf | 2009-11-23 15:14:48 +0100 | [diff] [blame] | 11 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 12 | #ifndef CONFIG_LINUX_FALLOCATE |
| 13 | int fallocate(int fd, int mode, off_t offset, off_t len) |
Jens Axboe | 804bb9a | 2011-07-12 20:49:46 +0200 | [diff] [blame] | 14 | { |
| 15 | errno = ENOSYS; |
| 16 | return -1; |
| 17 | } |
Wade Cline | bcb01f8 | 2012-08-01 08:45:48 +0200 | [diff] [blame] | 18 | #endif |
Jens Axboe | 804bb9a | 2011-07-12 20:49:46 +0200 | [diff] [blame] | 19 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 20 | #ifndef CONFIG_POSIX_FALLOCATE |
| 21 | int posix_fallocate(int fd, off_t offset, off_t len) |
Jens Axboe | ed80ddf | 2009-11-23 15:14:48 +0100 | [diff] [blame] | 22 | { |
| 23 | return 0; |
| 24 | } |
Jens Axboe | 285d451 | 2010-03-15 13:38:11 +0100 | [diff] [blame] | 25 | #endif |
Jens Axboe | c5c8bd5 | 2009-11-24 13:01:41 +0100 | [diff] [blame] | 26 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 27 | #ifndef CONFIG_SYNC_FILE_RANGE |
| 28 | int sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags) |
Jens Axboe | a54cf03 | 2010-03-13 11:29:47 +0100 | [diff] [blame] | 29 | { |
Jens Axboe | 285d451 | 2010-03-15 13:38:11 +0100 | [diff] [blame] | 30 | errno = ENOSYS; |
| 31 | return -1; |
Jens Axboe | a54cf03 | 2010-03-13 11:29:47 +0100 | [diff] [blame] | 32 | } |
Jens Axboe | 285d451 | 2010-03-15 13:38:11 +0100 | [diff] [blame] | 33 | #endif |
Jens Axboe | 09164e5 | 2012-11-29 21:27:20 +0100 | [diff] [blame] | 34 | |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 35 | #ifndef CONFIG_FADVISE |
| 36 | int posix_fadvise(int fd, off_t offset, off_t len, int advice) |
Jens Axboe | 09164e5 | 2012-11-29 21:27:20 +0100 | [diff] [blame] | 37 | { |
| 38 | return 0; |
| 39 | } |
| 40 | #endif |