OSDN Git Service

Cleanup a few structural wierdnesses
authorEric Andersen <andersen@codepoet.org>
Fri, 15 Nov 2002 14:06:44 +0000 (14:06 -0000)
committerEric Andersen <andersen@codepoet.org>
Fri, 15 Nov 2002 14:06:44 +0000 (14:06 -0000)
libc/sysdeps/linux/common/create_module.c
libc/sysdeps/linux/common/ftruncate64.c
libc/sysdeps/linux/common/pread_write.c
libc/sysdeps/linux/common/sendfile64.c
libc/sysdeps/linux/common/syscalls.c
libc/sysdeps/linux/common/truncate64.c

index 9b80fe8..426b0f1 100644 (file)
@@ -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
 
 
index 0ab6fd5..76b0c06 100644 (file)
 #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
 
index 98a0594..7955916 100644 (file)
@@ -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, 
index 17ba803..3c83c81 100644 (file)
 #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
index 63c70e8..9a91f2e 100644 (file)
@@ -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
 
index a23bac5..ba6d95d 100644 (file)
 #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