blob: c69533186c50ee2f399a425aea8a58d211d45a25 [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"
Jens Axboed09913c2009-12-16 19:23:10 +01009#include "os/os.h"
Jens Axboeed80ddf2009-11-23 15:14:48 +010010
Jens Axboe285d4512010-03-15 13:38:11 +010011#ifndef __NR_fallocate
Jens Axboeed80ddf2009-11-23 15:14:48 +010012int __weak posix_fallocate(int fd, off_t offset, off_t len)
13{
14 return 0;
15}
Jens Axboe285d4512010-03-15 13:38:11 +010016#endif
Jens Axboec5c8bd52009-11-24 13:01:41 +010017
18int __weak inet_aton(const char *cp, struct in_addr *inp)
19{
20 return 0;
21}
Jens Axboe2afd8262009-12-14 23:08:42 +010022
23int __weak clock_gettime(clockid_t clk_id, struct timespec *ts)
24{
25 struct timeval tv;
26 int ret;
27
28 ret = gettimeofday(&tv, NULL);
29
Jens Axboe3b2e1462009-12-15 08:58:10 +010030 ts->tv_sec = tv.tv_sec;
31 ts->tv_nsec = tv.tv_usec * 1000;
Jens Axboe2afd8262009-12-14 23:08:42 +010032
33 return ret;
34}
Jens Axboea54cf032010-03-13 11:29:47 +010035
Jens Axboe285d4512010-03-15 13:38:11 +010036#ifndef __NR_sync_file_range
Jens Axboea54cf032010-03-13 11:29:47 +010037int __weak sync_file_range(int fd, off64_t offset, off64_t nbytes,
38 unsigned int flags)
39{
Jens Axboe285d4512010-03-15 13:38:11 +010040 errno = ENOSYS;
41 return -1;
Jens Axboea54cf032010-03-13 11:29:47 +010042}
Jens Axboe285d4512010-03-15 13:38:11 +010043#endif