blob: 95625672b3417f0146e2f0c492a93ac4d54c54c0 [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
Jens Axboe804bb9a2011-07-12 20:49:46 +020012int _weak fallocate(int fd, int mode, off_t offset, off_t len)
13{
14 errno = ENOSYS;
15 return -1;
16}
17
Jens Axboe285d4512010-03-15 13:38:11 +010018#ifndef __NR_fallocate
Bruce Cranc3d31782011-07-10 20:56:23 +020019int _weak posix_fallocate(int fd, off_t offset, off_t len)
Jens Axboeed80ddf2009-11-23 15:14:48 +010020{
21 return 0;
22}
Jens Axboe285d4512010-03-15 13:38:11 +010023#endif
Jens Axboec5c8bd52009-11-24 13:01:41 +010024
Bruce Cranc3d31782011-07-10 20:56:23 +020025int _weak inet_aton(const char *cp, struct in_addr *inp)
Jens Axboec5c8bd52009-11-24 13:01:41 +010026{
27 return 0;
28}
Jens Axboe2afd8262009-12-14 23:08:42 +010029
Bruce Cranc3d31782011-07-10 20:56:23 +020030int _weak clock_gettime(clockid_t clk_id, struct timespec *ts)
Jens Axboe2afd8262009-12-14 23:08:42 +010031{
32 struct timeval tv;
33 int ret;
34
35 ret = gettimeofday(&tv, NULL);
36
Jens Axboe3b2e1462009-12-15 08:58:10 +010037 ts->tv_sec = tv.tv_sec;
38 ts->tv_nsec = tv.tv_usec * 1000;
Jens Axboe2afd8262009-12-14 23:08:42 +010039
40 return ret;
41}
Jens Axboea54cf032010-03-13 11:29:47 +010042
Jens Axboe285d4512010-03-15 13:38:11 +010043#ifndef __NR_sync_file_range
Bruce Cranc3d31782011-07-10 20:56:23 +020044int _weak sync_file_range(int fd, off64_t offset, off64_t nbytes,
Jens Axboea54cf032010-03-13 11:29:47 +010045 unsigned int flags)
46{
Jens Axboe285d4512010-03-15 13:38:11 +010047 errno = ENOSYS;
48 return -1;
Jens Axboea54cf032010-03-13 11:29:47 +010049}
Jens Axboe285d4512010-03-15 13:38:11 +010050#endif