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