| 1 | #include <malloc.h> |
| 2 | #include <stdlib.h> |
| 3 | #include <errno.h> |
| 4 | #include <sys/socket.h> |
| 5 | #include <netinet/in.h> |
| 6 | |
| 7 | #include "compiler/compiler.h" |
| 8 | |
| 9 | int __weak posix_memalign(void **ptr, size_t align, size_t size) |
| 10 | { |
| 11 | *ptr = memalign(align, size); |
| 12 | if (*ptr) |
| 13 | return 0; |
| 14 | |
| 15 | return ENOMEM; |
| 16 | } |
| 17 | |
| 18 | int __weak posix_fallocate(int fd, off_t offset, off_t len) |
| 19 | { |
| 20 | return 0; |
| 21 | } |
| 22 | |
| 23 | int __weak inet_aton(const char *cp, struct in_addr *inp) |
| 24 | { |
| 25 | return 0; |
| 26 | } |
| 27 | |
| 28 | int __weak clock_gettime(clockid_t clk_id, struct timespec *ts) |
| 29 | { |
| 30 | struct timeval tv; |
| 31 | int ret; |
| 32 | |
| 33 | ret = gettimeofday(&tv, NULL); |
| 34 | |
| 35 | ts->tv_sec = tv.tv_sec; |
| 36 | ts->tv_nsec = tv.tv_usec * 1000; |
| 37 | |
| 38 | return ret; |
| 39 | } |