summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-04-17 11:27:15 +0000
committerEric Andersen <andersen@codepoet.org>2002-04-17 11:27:15 +0000
commit9b4cbe2e11e602d2a947d17782649cf27e937789 (patch)
treecddbfc1fd046901e7d658c7a87206945a299c1b8
parent108202d604f40cf390c5ec57bd60297a189b350c (diff)
Stub out pread and pwrite when not available
-rw-r--r--libc/sysdeps/linux/common/syscalls.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/syscalls.c b/libc/sysdeps/linux/common/syscalls.c
index 2f2d9fd59..4c623264b 100644
--- a/libc/sysdeps/linux/common/syscalls.c
+++ b/libc/sysdeps/linux/common/syscalls.c
@@ -1370,6 +1370,7 @@ int sigsuspend (const sigset_t *mask)
#endif
//#define __NR_pread 180
+#ifdef __NR_pread
#ifdef L___libc_pread
#define _XOPEN_SOURCE 500
#include <unistd.h>
@@ -1377,8 +1378,16 @@ int sigsuspend (const sigset_t *mask)
_syscall4(ssize_t, __libc_pread, int, fd, void *, buf, size_t, count, __off_t, offset);
weak_alias (__libc_pread, pread)
#endif
+#else
+ssize_t pread(int fd, void *buf, size_t count, off_t offset)
+{
+ __set_errno(ENOSYS);
+ return -1;
+}
+#endif
//#define __NR_pwrite 181
+#ifdef __NR_pwrite
#ifdef L___libc_pwrite
#define _XOPEN_SOURCE 500
#include <unistd.h>
@@ -1386,6 +1395,13 @@ weak_alias (__libc_pread, pread)
_syscall4(ssize_t, __libc_pwrite, int, fd, const void *, buf, size_t, count, __off_t, offset);
weak_alias (__libc_pwrite, pwrite)
#endif
+#else
+ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+ __set_errno(ENOSYS);
+ return -1;
+}
+#endif
//#define __NR_chown 182
#ifdef L_chown