path: root/os/windows/posix.h
diff options
authorBruce Cran <>2013-02-06 23:55:46 +0000
committerJens Axboe <>2013-02-07 07:22:03 +0100
commit10a6b3c67042914fe9d287027bf8792f69e84524 (patch)
treea88e73fd732e39be50fae3174855108cb6d3c49b /os/windows/posix.h
parent01d269552bca14c90bdcc2288e64ba2426c045ea (diff)
Windows: fix mlock, remove ftruncate and fix error handling.
Functions in posix.c need to use win_to_posix_err to convert errors from Windows API calls to their equivalent POSIX error code so perror etc. work: move it into posix.c and add the prototype to posix.h. Fix error handling so -1 is always returned on error and errno is set. Fix mlock to work with sizes greater than about 1MB: the working set size needs to be increased for the new allocation. Remove ftruncate from posix.c, since MinGW already provides it. Signed-off-by: Jens Axboe <>
Diffstat (limited to 'os/windows/posix.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/os/windows/posix.h b/os/windows/posix.h
index cb89cf6e..85640a21 100644
--- a/os/windows/posix.h
+++ b/os/windows/posix.h
@@ -6,5 +6,6 @@ typedef int clockid_t;
extern int clock_gettime(clockid_t clock_id, struct timespec *tp);
extern int inet_aton(const char *, struct in_addr *);
+extern int win_to_posix_error(DWORD winerr);