]> Zhao Yanbai Git Server - minix.git/commitdiff
Missing lseek64 library functions.
authorPhilip Homburg <philip@cs.vu.nl>
Thu, 7 Dec 2006 20:01:43 +0000 (20:01 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Thu, 7 Dec 2006 20:01:43 +0000 (20:01 +0000)
lib/other/_lseek64.c [new file with mode: 0644]
lib/syscall/lseek64.s [new file with mode: 0644]

diff --git a/lib/other/_lseek64.c b/lib/other/_lseek64.c
new file mode 100644 (file)
index 0000000..e4aa9c5
--- /dev/null
@@ -0,0 +1,22 @@
+#include <lib.h>
+#define lseek64        _lseek64
+#include <unistd.h>
+#include <minix/u64.h>
+
+PUBLIC int lseek64(fd, offset, whence, newpos)
+int fd;
+u64_t offset;
+int whence;
+u64_t *newpos;
+{
+  message m;
+
+  m.m2_i1 = fd;
+  m.m2_l1 = ex64lo(offset);
+  m.m2_l2 = ex64hi(offset);
+  m.m2_i2 = whence;
+  if (_syscall(FS, LLSEEK, &m) < 0) return -1;
+  if (newpos)
+       *newpos= make64(m.m2_l2, m.m2_l1);
+  return 0;
+}
diff --git a/lib/syscall/lseek64.s b/lib/syscall/lseek64.s
new file mode 100644 (file)
index 0000000..ec8600e
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text
+.extern        __lseek64
+.define        _lseek64
+.align 2
+
+_lseek64:
+       jmp     __lseek64