summaryrefslogtreecommitdiff
path: root/lib9/pread-Nt.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib9/pread-Nt.c')
-rw-r--r--lib9/pread-Nt.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib9/pread-Nt.c b/lib9/pread-Nt.c
new file mode 100644
index 00000000..94fc81d5
--- /dev/null
+++ b/lib9/pread-Nt.c
@@ -0,0 +1,9 @@
+#include "lib9.h"
+
+long
+pread(int fd, void *buf, long n, vlong offset)
+{
+ if(seek(fd, offset, 0) < 0)
+ return -1;
+ return read(fd, buf, n);
+}