]> wimlib.net Git - wimlib/blobdiff - src/write.c
Add Windows implementations of pread(), pwrite(), writev()
[wimlib] / src / write.c
index 16ce531aacc2850b1d096f243d6e257030c566f9..1dd35e52c047f14316ac223ee529ce39ba3def3c 100644 (file)
@@ -48,6 +48,7 @@
 #endif
 
 #include <unistd.h>
+#include <fcntl.h>
 #include <errno.h>
 
 #ifdef WITH_NTFS_3G
 
 #include <limits.h>
 
+#ifndef __WIN32__
+#  include <sys/uio.h> /* for `struct iovec' */
+#endif
+
 /* Chunk table that's located at the beginning of each compressed resource in
  * the WIM.  (This is not the on-disk format; the on-disk format just has an
  * array of offsets.) */
@@ -1833,7 +1838,7 @@ lock_wim(WIMStruct *w, filedes_t fd)
 static int
 open_wim_writable(WIMStruct *w, const tchar *path, int open_flags)
 {
-       w->out_fd = open(path, open_flags, 0644);
+       w->out_fd = topen(path, open_flags, 0644);
        if (w->out_fd == INVALID_FILEDES) {
                ERROR_WITH_ERRNO("Failed to open `%"TS"' for writing", path);
                return WIMLIB_ERR_OPEN;