]> wimlib.net Git - wimlib/blobdiff - src/file_io.c
mount_image.c: add fallback definitions of RENAME_* constants
[wimlib] / src / file_io.c
index f641aa28d1947569e304536cf475cd145a81a862..4cd71ec43f387864182a5e83339d66586afd067e 100644 (file)
@@ -16,7 +16,7 @@
  * details.
  *
  * You should have received a copy of the GNU Lesser General Public License
- * along with this file; if not, see http://www.gnu.org/licenses/.
+ * along with this file; if not, see https://www.gnu.org/licenses/.
  */
 
 #ifdef HAVE_CONFIG_H
 #include "wimlib/error.h"
 #include "wimlib/file_io.h"
 #include "wimlib/util.h"
-#include "wimlib/win32.h" /* For pread(), pwrite() replacements */
+
+#ifdef _WIN32
+#  include "wimlib/win32.h"
+#  define read win32_read
+#  define write win32_write
+#  define pread win32_pread
+#  define pwrite win32_pwrite
+#endif
 
 /*
  * Wrapper around read() that checks for errors and keeps retrying until all
@@ -185,18 +192,6 @@ full_pwrite(struct filedes *fd, const void *buf, size_t count, off_t offset)
        return 0;
 }
 
-ssize_t
-raw_pread(struct filedes *fd, void *buf, size_t count, off_t offset)
-{
-       return pread(fd->fd, buf, count, offset);
-}
-
-ssize_t
-raw_pwrite(struct filedes *fd, const void *buf, size_t count, off_t offset)
-{
-       return pwrite(fd->fd, buf, count, offset);
-}
-
 off_t filedes_seek(struct filedes *fd, off_t offset)
 {
        if (fd->is_pipe) {