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" | ||||
Jens Axboe | d09913c | 2009-12-16 19:23:10 +0100 | [diff] [blame] | 9 | #include "os/os.h" |
Jens Axboe | ed80ddf | 2009-11-23 15:14:48 +0100 | [diff] [blame] | 10 | |
Jens Axboe | 285d451 | 2010-03-15 13:38:11 +0100 | [diff] [blame] | 11 | #ifndef __NR_fallocate |
Jens Axboe | ed80ddf | 2009-11-23 15:14:48 +0100 | [diff] [blame] | 12 | int __weak posix_fallocate(int fd, off_t offset, off_t len) |
13 | { | ||||
14 | return 0; | ||||
15 | } | ||||
Jens Axboe | 285d451 | 2010-03-15 13:38:11 +0100 | [diff] [blame] | 16 | #endif |
Jens Axboe | c5c8bd5 | 2009-11-24 13:01:41 +0100 | [diff] [blame] | 17 | |
18 | int __weak inet_aton(const char *cp, struct in_addr *inp) | ||||
19 | { | ||||
20 | return 0; | ||||
21 | } | ||||
Jens Axboe | 2afd826 | 2009-12-14 23:08:42 +0100 | [diff] [blame] | 22 | |
23 | int __weak clock_gettime(clockid_t clk_id, struct timespec *ts) | ||||
24 | { | ||||
25 | struct timeval tv; | ||||
26 | int ret; | ||||
27 | |||||
28 | ret = gettimeofday(&tv, NULL); | ||||
29 | |||||
Jens Axboe | 3b2e146 | 2009-12-15 08:58:10 +0100 | [diff] [blame] | 30 | ts->tv_sec = tv.tv_sec; |
31 | ts->tv_nsec = tv.tv_usec * 1000; | ||||
Jens Axboe | 2afd826 | 2009-12-14 23:08:42 +0100 | [diff] [blame] | 32 | |
33 | return ret; | ||||
34 | } | ||||
Jens Axboe | a54cf03 | 2010-03-13 11:29:47 +0100 | [diff] [blame] | 35 | |
Jens Axboe | 285d451 | 2010-03-15 13:38:11 +0100 | [diff] [blame] | 36 | #ifndef __NR_sync_file_range |
Jens Axboe | a54cf03 | 2010-03-13 11:29:47 +0100 | [diff] [blame] | 37 | int __weak sync_file_range(int fd, off64_t offset, off64_t nbytes, |
38 | unsigned int flags) | ||||
39 | { | ||||
Jens Axboe | 285d451 | 2010-03-15 13:38:11 +0100 | [diff] [blame] | 40 | errno = ENOSYS; |
41 | return -1; | ||||
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 | #endif |