X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=helpers.c;h=9b1f3e90468f58bc3e1f143d0fdbb29b3ae19573;hb=2363d8df7c0c6fe0613dc8e7ae2fa6f098cbc0d8;hp=f314ebb96ce7aa4c43302ad5f0e03dbd46ae83fb;hpb=c5c8bd5c9b265df2c7feb386b5c1fba0a5a34eec;p=fio.git diff --git a/helpers.c b/helpers.c index f314ebb9..9b1f3e90 100644 --- a/helpers.c +++ b/helpers.c @@ -1,19 +1,11 @@ -#include #include #include #include +#include #include #include "compiler/compiler.h" - -int __weak posix_memalign(void **ptr, size_t align, size_t size) -{ - *ptr = memalign(align, size); - if (*ptr) - return 0; - - return ENOMEM; -} +#include "os/os.h" int __weak posix_fallocate(int fd, off_t offset, off_t len) { @@ -24,3 +16,16 @@ 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; +}