summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-11-15 14:06:44 +0000
committerEric Andersen <andersen@codepoet.org>2002-11-15 14:06:44 +0000
commit80b0b55af2faa2e314d61d2f17fc24c9cfa94a34 (patch)
tree9944b254b1e5c829f1b7b099b129e563f19eae23 /libc/sysdeps/linux/common
parent4d3c7f75e644c67e3110fa7ded9eb6af696f8ef2 (diff)
Cleanup a few structural wierdnesses
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/create_module.c2
-rw-r--r--libc/sysdeps/linux/common/ftruncate64.c12
-rw-r--r--libc/sysdeps/linux/common/pread_write.c3
-rw-r--r--libc/sysdeps/linux/common/sendfile64.c18
-rw-r--r--libc/sysdeps/linux/common/syscalls.c4
-rw-r--r--libc/sysdeps/linux/common/truncate64.c11
6 files changed, 27 insertions, 23 deletions
diff --git a/libc/sysdeps/linux/common/create_module.c b/libc/sysdeps/linux/common/create_module.c
index 9b80fe84e..426b0f178 100644
--- a/libc/sysdeps/linux/common/create_module.c
+++ b/libc/sysdeps/linux/common/create_module.c
@@ -61,7 +61,7 @@ unsigned long create_module(const char *name, size_t size)
}
#else
/* Sparc, MIPS, etc don't mistake return values for errors. */
-_syscall2(unsigned long, create_module, const char *, name, size_t, size)
+_syscall2(unsigned long, create_module, const char *, name, size_t, size);
#endif
diff --git a/libc/sysdeps/linux/common/ftruncate64.c b/libc/sysdeps/linux/common/ftruncate64.c
index 0ab6fd5b9..76b0c0636 100644
--- a/libc/sysdeps/linux/common/ftruncate64.c
+++ b/libc/sysdeps/linux/common/ftruncate64.c
@@ -19,15 +19,17 @@
#include <stdint.h>
#include <sys/syscall.h>
-#if defined __UCLIBC_HAS_LFS__ && defined __NR_ftruncate64
+#if defined __NR_ftruncate64
-#if __WORDSIZE == 64
+#if __WORDSIZE == 64 || (defined(__powerpc__) && defined (__UCLIBC_HAS_LFS__))
/* For a 64 bit machine, life is simple... */
_syscall2(int, ftruncate64, int, fd, __off64_t, length);
#elif __WORDSIZE == 32
+#if defined __UCLIBC_HAS_LFS__
+
#ifndef INLINE_SYSCALL
#define INLINE_SYSCALL(name, nr, args...) __syscall_ftruncate64 (args)
#define __NR___syscall_ftruncate64 __NR_ftruncate64
@@ -42,11 +44,11 @@ int ftruncate64 (int fd, __off64_t length)
uint32_t high = length >> 32;
return INLINE_SYSCALL(ftruncate64, 3, fd, __LONG_LONG_PAIR (high, low));
}
+#endif /* __UCLIBC_HAS_LFS__ */
-#else
+#else /* __WORDSIZE */
#error Your machine is not 64 bit or 32 bit, I am dazed and confused.
#endif /* __WORDSIZE */
-#endif /* __UCLIBC_HAS_LFS__ */
-
+#endif
diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
index 98a059416..7955916fe 100644
--- a/libc/sysdeps/linux/common/pread_write.c
+++ b/libc/sysdeps/linux/common/pread_write.c
@@ -45,8 +45,6 @@
static inline _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
size_t, count, off_t, offset_hi, off_t, offset_lo);
-#define __NR___libc_pread __NR_pread
-
ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
{
return(__syscall_pread(fd,buf,count,__LONG_LONG_PAIR((off_t)0,offset)));
@@ -66,7 +64,6 @@ weak_alias (__libc_pread64, pread64)
#ifdef __NR_pwrite
-#define __NR___libc_pwrite __NR_pwrite
#define __NR___syscall_pwrite __NR_pwrite
static inline _syscall5(ssize_t, __syscall_pwrite, int, fd, const void *, buf,
diff --git a/libc/sysdeps/linux/common/sendfile64.c b/libc/sysdeps/linux/common/sendfile64.c
index 17ba803ea..3c83c81ad 100644
--- a/libc/sysdeps/linux/common/sendfile64.c
+++ b/libc/sysdeps/linux/common/sendfile64.c
@@ -20,27 +20,29 @@
#include <sys/sendfile.h>
#include <sys/syscall.h>
+#if defined __NR_sendfile64
-#if __WORDSIZE == 64
+#if __WORDSIZE == 64 || (defined(__powerpc__) && defined (__UCLIBC_HAS_LFS__))
/* For a 64 bit machine, life is simple... */
_syscall4(ssize_t,sendfile64, int, out_fd, int, in_fd, __off64_t *, offset, size_t, count)
#elif __WORDSIZE == 32
#if defined __UCLIBC_HAS_LFS__
-#if defined __NR_sendfile64
_syscall4(ssize_t,sendfile64, int, out_fd, int, in_fd, __off64_t *, offset, size_t, count)
+#endif /* __UCLIBC_HAS_LFS__ */
+
+#else /* __WORDSIZE */
+#error Your machine is not 64 bit or 32 bit, I am dazed and confused.
+#endif /* __WORDSIZE */
+
+
+#else /* ! defined __NR_sendfile64 */
-#else
ssize_t sendfile64 (int out_fd, int in_fd, __off64_t *offset, size_t count)
{
__set_errno (ENOSYS);
return -1;
}
-#endif
-
-#endif /* __UCLIBC_HAS_LFS__ */
-#else /* __WORDSIZE */
-#error Your machine is not 64 bit or 32 bit, I am dazed and confused.
#endif
diff --git a/libc/sysdeps/linux/common/syscalls.c b/libc/sysdeps/linux/common/syscalls.c
index 63c70e85a..9a91f2e65 100644
--- a/libc/sysdeps/linux/common/syscalls.c
+++ b/libc/sysdeps/linux/common/syscalls.c
@@ -1586,7 +1586,7 @@ _syscall2(int, sigaltstack, const struct sigaltstack *, ss, struct sigaltstack *
#ifdef L_sendfile
#include <unistd.h>
#include <sys/sendfile.h>
-_syscall4(ssize_t,sendfile, int, out_fd, int, in_fd, __off_t *, offset, size_t, count)
+_syscall4(ssize_t,sendfile, int, out_fd, int, in_fd, __off_t *, offset, size_t, count);
#endif
#endif
@@ -1672,7 +1672,7 @@ _syscall2(int, fstat64, int, filedes, struct stat64 *, buf);
//#define __NR_pivot_root 217
#ifdef __NR_pivot_root
#ifdef L_pivot_root
-_syscall2(int, pivot_root, const char *, new_root, const char *, put_old)
+_syscall2(int, pivot_root, const char *, new_root, const char *, put_old);
#endif
#endif
diff --git a/libc/sysdeps/linux/common/truncate64.c b/libc/sysdeps/linux/common/truncate64.c
index a23bac536..ba6d95d1d 100644
--- a/libc/sysdeps/linux/common/truncate64.c
+++ b/libc/sysdeps/linux/common/truncate64.c
@@ -19,15 +19,17 @@
#include <stdint.h>
#include <sys/syscall.h>
-#if defined __UCLIBC_HAS_LFS__ && defined __NR_truncate64
+#if defined __NR_truncate64
-#if __WORDSIZE == 64
+#if __WORDSIZE == 64 || (defined(__powerpc__) && defined (__UCLIBC_HAS_LFS__))
/* For a 64 bit machine, life is simple... */
_syscall2(int, truncate64, const char *, path, __off64_t, length);
#elif __WORDSIZE == 32
+#if defined __UCLIBC_HAS_LFS__
+
#ifndef INLINE_SYSCALL
#define INLINE_SYSCALL(name, nr, args...) __syscall_truncate64 (args)
#define __NR___syscall_truncate64 __NR_truncate64
@@ -42,10 +44,11 @@ int truncate64 (const char * path, __off64_t length)
uint32_t high = length >> 32;
return INLINE_SYSCALL(truncate64, 3, path, __LONG_LONG_PAIR (high, low));
}
+#endif /* __UCLIBC_HAS_LFS__ */
-#else
+#else /* __WORDSIZE */
#error Your machine is not 64 bit or 32 bit, I am dazed and confused.
#endif /* __WORDSIZE */
-#endif /* __UCLIBC_HAS_LFS__ */
+#endif