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 | |
Wade Cline | bcb01f8 | 2012-08-01 08:45:48 +0200 | [diff] [blame] | 12 | #ifndef FIO_HAVE_LINUX_FALLOCATE |
Jens Axboe | 804bb9a | 2011-07-12 20:49:46 +0200 | [diff] [blame] | 13 | int _weak fallocate(int fd, int mode, off_t offset, off_t len) |
| 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 | 285d451 | 2010-03-15 13:38:11 +0100 | [diff] [blame] | 20 | #ifndef __NR_fallocate |
Bruce Cran | c3d3178 | 2011-07-10 20:56:23 +0200 | [diff] [blame] | 21 | int _weak 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 | |
Bruce Cran | c3d3178 | 2011-07-10 20:56:23 +0200 | [diff] [blame] | 27 | int _weak inet_aton(const char *cp, struct in_addr *inp) |
Jens Axboe | c5c8bd5 | 2009-11-24 13:01:41 +0100 | [diff] [blame] | 28 | { |
| 29 | return 0; |
| 30 | } |
Jens Axboe | 2afd826 | 2009-12-14 23:08:42 +0100 | [diff] [blame] | 31 | |
Bruce Cran | c3d3178 | 2011-07-10 20:56:23 +0200 | [diff] [blame] | 32 | int _weak clock_gettime(clockid_t clk_id, struct timespec *ts) |
Jens Axboe | 2afd826 | 2009-12-14 23:08:42 +0100 | [diff] [blame] | 33 | { |
| 34 | struct timeval tv; |
| 35 | int ret; |
| 36 | |
| 37 | ret = gettimeofday(&tv, NULL); |
| 38 | |
Jens Axboe | 3b2e146 | 2009-12-15 08:58:10 +0100 | [diff] [blame] | 39 | ts->tv_sec = tv.tv_sec; |
| 40 | ts->tv_nsec = tv.tv_usec * 1000; |
Jens Axboe | 2afd826 | 2009-12-14 23:08:42 +0100 | [diff] [blame] | 41 | |
| 42 | return ret; |
| 43 | } |
Jens Axboe | a54cf03 | 2010-03-13 11:29:47 +0100 | [diff] [blame] | 44 | |
Jens Axboe | 285d451 | 2010-03-15 13:38:11 +0100 | [diff] [blame] | 45 | #ifndef __NR_sync_file_range |
Bruce Cran | c3d3178 | 2011-07-10 20:56:23 +0200 | [diff] [blame] | 46 | int _weak sync_file_range(int fd, off64_t offset, off64_t nbytes, |
Jens Axboe | a54cf03 | 2010-03-13 11:29:47 +0100 | [diff] [blame] | 47 | unsigned int flags) |
| 48 | { |
Jens Axboe | 285d451 | 2010-03-15 13:38:11 +0100 | [diff] [blame] | 49 | errno = ENOSYS; |
| 50 | return -1; |
Jens Axboe | a54cf03 | 2010-03-13 11:29:47 +0100 | [diff] [blame] | 51 | } |
Jens Axboe | 285d451 | 2010-03-15 13:38:11 +0100 | [diff] [blame] | 52 | #endif |