summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/syscalls.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-07-15 09:59:46 +0000
committerEric Andersen <andersen@codepoet.org>2002-07-15 09:59:46 +0000
commit17c362cce61538cf64beb33c524c21344be090bc (patch)
tree14066c63be2778166041e40b95c109b0af8ce646 /libc/sysdeps/linux/common/syscalls.c
parent6d1ef1d459abf5b0edb371270ae0a893690df704 (diff)
Rework pread and pwrite support so it should actually work.
Add support for pread64 and pwrite64. Fixup llseek a bit. -Erik
Diffstat (limited to 'libc/sysdeps/linux/common/syscalls.c')
-rw-r--r--libc/sysdeps/linux/common/syscalls.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/libc/sysdeps/linux/common/syscalls.c b/libc/sysdeps/linux/common/syscalls.c
index 318bbfbb3..1b63c3dba 100644
--- a/libc/sysdeps/linux/common/syscalls.c
+++ b/libc/sysdeps/linux/common/syscalls.c
@@ -1254,8 +1254,8 @@ __loff_t __libc_lseek64(int fd, __loff_t offset, int whence)
int ret;
__loff_t result;
- ret = _llseek(fd, (__off_t) (offset >> 32),
- (__off_t) (offset & 0xffffffff), &result, whence);
+ ret = _llseek(fd, __LONG_LONG_PAIR((__off_t) (offset >> 32),
+ (__off_t) (offset & 0xffffffff)), &result, whence);
return ret ? (__loff_t) ret : result;
}
@@ -1574,38 +1574,10 @@ int sigsuspend (const sigset_t *mask)
#endif
//#define __NR_pread 180
-#ifdef L___libc_pread
-#ifdef __NR_pread
-#define _XOPEN_SOURCE 500
-#include <unistd.h>
-#define __NR___libc_pread __NR_pread
-_syscall4(ssize_t, __libc_pread, int, fd, void *, buf, size_t, count, __off_t, offset);
-weak_alias (__libc_pread, pread)
-#else
-ssize_t pread(int fd, void *buf, size_t count, off_t offset)
-{
- __set_errno(ENOSYS);
- return -1;
-}
-#endif
-#endif
+// See pread_write.c
//#define __NR_pwrite 181
-#ifdef L___libc_pwrite
-#ifdef __NR_pwrite
-#define _XOPEN_SOURCE 500
-#include <unistd.h>
-#define __NR___libc_pwrite __NR_pwrite
-_syscall4(ssize_t, __libc_pwrite, int, fd, const void *, buf, size_t, count, __off_t, offset);
-weak_alias (__libc_pwrite, pwrite)
-#else
-ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset)
-{
- __set_errno(ENOSYS);
- return -1;
-}
-#endif
-#endif
+// See pread_write.c
//#define __NR_chown 182
#ifdef L_chown