Commit | Line | Data |
---|---|---|
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 | |
804bb9a1 JA |
12 | int _weak fallocate(int fd, int mode, off_t offset, off_t len) |
13 | { | |
14 | errno = ENOSYS; | |
15 | return -1; | |
16 | } | |
17 | ||
285d451f | 18 | #ifndef __NR_fallocate |
c3d3178b | 19 | int _weak posix_fallocate(int fd, off_t offset, off_t len) |
ed80ddf6 JA |
20 | { |
21 | return 0; | |
22 | } | |
285d451f | 23 | #endif |
c5c8bd5c | 24 | |
c3d3178b | 25 | int _weak inet_aton(const char *cp, struct in_addr *inp) |
c5c8bd5c JA |
26 | { |
27 | return 0; | |
28 | } | |
2afd826b | 29 | |
c3d3178b | 30 | int _weak clock_gettime(clockid_t clk_id, struct timespec *ts) |
2afd826b JA |
31 | { |
32 | struct timeval tv; | |
33 | int ret; | |
34 | ||
35 | ret = gettimeofday(&tv, NULL); | |
36 | ||
3b2e1464 JA |
37 | ts->tv_sec = tv.tv_sec; |
38 | ts->tv_nsec = tv.tv_usec * 1000; | |
2afd826b JA |
39 | |
40 | return ret; | |
41 | } | |
a54cf034 | 42 | |
285d451f | 43 | #ifndef __NR_sync_file_range |
c3d3178b | 44 | int _weak sync_file_range(int fd, off64_t offset, off64_t nbytes, |
a54cf034 JA |
45 | unsigned int flags) |
46 | { | |
285d451f JA |
47 | errno = ENOSYS; |
48 | return -1; | |
a54cf034 | 49 | } |
285d451f | 50 | #endif |