Merge branch 'master' into gfio
[fio.git] / os / windows / posix.c
index 6ad47df8c7d08381314460558f05aba166f22216..f616e876ba79e70c84d862535861d43f848da72d 100755 (executable)
@@ -411,6 +411,9 @@ int posix_fallocate(int fd, off_t offset, off_t len)
                        break;
                }
 
+               /* Don't allow Windows to cache the write: flush it to disk */
+               _commit(fd);
+
                bytes_remaining -= bytes_written;
        }
 
@@ -532,6 +535,11 @@ int getrusage(int who, struct rusage *r_usage)
        return 0;
 }
 
+int posix_fadvise(int fd, off_t offset, off_t len, int advice)
+{
+       return 0;
+}
+
 int posix_madvise(void *addr, size_t len, int advice)
 {
        log_err("%s is not implemented\n", __func__);
@@ -628,11 +636,11 @@ int poll(struct pollfd fds[], nfds_t nfds, int timeout)
        int i;
        int rc;
 
-       if (timeout != -1)
+       if (timeout != -1) {
                to = &tv;
-
-       to->tv_sec = timeout / 1000;
-       to->tv_usec = (timeout % 1000) * 1000;
+               to->tv_sec = timeout / 1000;
+               to->tv_usec = (timeout % 1000) * 1000;
+       }
 
        FD_ZERO(&readfds);
        FD_ZERO(&writefds);
@@ -811,9 +819,15 @@ const char* inet_ntop(int af, const void *restrict src,
                errno = ENOSPC;
 
        WSACleanup();
+
        return ret;
 }
 
+int inet_aton(const char *cp, struct in_addr *inp)
+{
+       return inet_pton(AF_INET, cp, inp);
+}
+
 int inet_pton(int af, const char *restrict src, void *restrict dst)
 {
        INT status = SOCKET_ERROR;