blob: 5be45ccf5f3954b3c87494132d7f0cdf94825814 [file] [log] [blame]
Jens Axboeed80ddf2009-11-23 15:14:48 +01001#include <stdlib.h>
Jens Axboef1662802009-11-24 08:48:21 +01002#include <errno.h>
Jens Axboec5c8bd52009-11-24 13:01:41 +01003#include <sys/socket.h>
Jens Axboef8ed6d82009-12-16 09:50:05 +01004#include <sys/time.h>
Jens Axboec5c8bd52009-11-24 13:01:41 +01005#include <netinet/in.h>
Jens Axboe285d4512010-03-15 13:38:11 +01006#include <unistd.h>
Jens Axboeed80ddf2009-11-23 15:14:48 +01007
8#include "compiler/compiler.h"
Joss Grossman6fe1c1d2010-09-30 10:51:42 +09009#include "arch/arch.h"
Jens Axboed09913c2009-12-16 19:23:10 +010010#include "os/os.h"
Jens Axboeed80ddf2009-11-23 15:14:48 +010011
Wade Clinebcb01f82012-08-01 08:45:48 +020012#ifndef FIO_HAVE_LINUX_FALLOCATE
Jens Axboe804bb9a2011-07-12 20:49:46 +020013int _weak fallocate(int fd, int mode, off_t offset, off_t len)
14{
15 errno = ENOSYS;
16 return -1;
17}
Wade Clinebcb01f82012-08-01 08:45:48 +020018#endif
Jens Axboe804bb9a2011-07-12 20:49:46 +020019
Jens Axboe285d4512010-03-15 13:38:11 +010020#ifndef __NR_fallocate
Bruce Cranc3d31782011-07-10 20:56:23 +020021int _weak posix_fallocate(int fd, off_t offset, off_t len)
Jens Axboeed80ddf2009-11-23 15:14:48 +010022{
23 return 0;
24}
Jens Axboe285d4512010-03-15 13:38:11 +010025#endif
Jens Axboec5c8bd52009-11-24 13:01:41 +010026
Bruce Cranc3d31782011-07-10 20:56:23 +020027int _weak inet_aton(const char *cp, struct in_addr *inp)
Jens Axboec5c8bd52009-11-24 13:01:41 +010028{
29 return 0;
30}
Jens Axboe2afd8262009-12-14 23:08:42 +010031
Bruce Cranc3d31782011-07-10 20:56:23 +020032int _weak clock_gettime(clockid_t clk_id, struct timespec *ts)
Jens Axboe2afd8262009-12-14 23:08:42 +010033{
34 struct timeval tv;
35 int ret;
36
37 ret = gettimeofday(&tv, NULL);
38
Jens Axboe3b2e1462009-12-15 08:58:10 +010039 ts->tv_sec = tv.tv_sec;
40 ts->tv_nsec = tv.tv_usec * 1000;
Jens Axboe2afd8262009-12-14 23:08:42 +010041
42 return ret;
43}
Jens Axboea54cf032010-03-13 11:29:47 +010044
Jens Axboe285d4512010-03-15 13:38:11 +010045#ifndef __NR_sync_file_range
Bruce Cranc3d31782011-07-10 20:56:23 +020046int _weak sync_file_range(int fd, off64_t offset, off64_t nbytes,
Jens Axboea54cf032010-03-13 11:29:47 +010047 unsigned int flags)
48{
Jens Axboe285d4512010-03-15 13:38:11 +010049 errno = ENOSYS;
50 return -1;
Jens Axboea54cf032010-03-13 11:29:47 +010051}
Jens Axboe285d4512010-03-15 13:38:11 +010052#endif