X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=helpers.c;h=8ac58239fef434a5338fcce4f3f54f65586ed22d;hp=987f5b683bb08c0014fb17eae1b1099b3754f722;hb=f8ed6d895233a874ce4e119f24d759445dff254d;hpb=ed80ddf66943dc2654a92eb77b57c3d68613e9d6 diff --git a/helpers.c b/helpers.c index 987f5b68..8ac58239 100644 --- a/helpers.c +++ b/helpers.c @@ -1,15 +1,30 @@ -#include #include +#include +#include +#include +#include #include "compiler/compiler.h" -int __weak posix_memalign(void **ptr, size_t align, size_t size) +int __weak posix_fallocate(int fd, off_t offset, off_t len) { - *ptr = memalign(align, size); - return *ptr == NULL; + return 0; } -int __weak posix_fallocate(int fd, off_t offset, off_t len) +int __weak inet_aton(const char *cp, struct in_addr *inp) { return 0; } + +int __weak clock_gettime(clockid_t clk_id, struct timespec *ts) +{ + struct timeval tv; + int ret; + + ret = gettimeofday(&tv, NULL); + + ts->tv_sec = tv.tv_sec; + ts->tv_nsec = tv.tv_usec * 1000; + + return ret; +}