[git commit] ldso: unify pread syscall definition

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Thu Oct 6 20:38:20 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=7eaca202b9f1f79a3c1d2a56a3879364cfa89e42
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

A few arches want pread() defined, so move it to common code.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 ldso/include/dl-syscall.h    |   22 ++++++++++++++++++++++
 ldso/ldso/bfin/dl-syscalls.h |   12 ------------
 ldso/ldso/c6x/dl-syscalls.h  |   18 +-----------------
 ldso/ldso/frv/dl-syscalls.h  |   18 +-----------------
 4 files changed, 24 insertions(+), 46 deletions(-)

diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h
index 7539c22..547dad1 100644
--- a/ldso/include/dl-syscall.h
+++ b/ldso/include/dl-syscall.h
@@ -108,6 +108,28 @@ static __always_inline _syscall0(gid_t, _dl_getpid)
 static __always_inline _syscall3(int, _dl_readlink, const char *, path, char *, buf,
                         size_t, bufsiz)
 
+#ifdef __NR_pread64
+#define __NR___syscall_pread __NR_pread64
+static __always_inline _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
+			size_t, count, off_t, offset_hi, off_t, offset_lo)
+
+static __always_inline ssize_t
+_dl_pread(int fd, void *buf, size_t count, off_t offset)
+{
+	return __syscall_pread(fd, buf, count, offset, offset >> 31);
+}
+#elif defined __NR_pread
+#define __NR___syscall_pread __NR_pread
+static __always_inline _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
+			size_t, count, off_t, offset_hi, off_t, offset_lo)
+
+static __always_inline ssize_t
+_dl_pread(int fd, void *buf, size_t count, off_t offset)
+{
+	return __syscall_pread(fd, buf, count, __LONG_LONG_PAIR(offset >> 31, offset));
+}
+#endif
+
 #ifdef __UCLIBC_HAS_SSP__
 # include <sys/time.h>
 # define __NR__dl_gettimeofday __NR_gettimeofday
diff --git a/ldso/ldso/bfin/dl-syscalls.h b/ldso/ldso/bfin/dl-syscalls.h
index f9577ba..29a4514 100644
--- a/ldso/ldso/bfin/dl-syscalls.h
+++ b/ldso/ldso/bfin/dl-syscalls.h
@@ -18,18 +18,6 @@ License along with uClibc; see the file COPYING.LIB.  If not, write to
 the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
 USA.  */
 
-#ifdef __NR_pread
-#define __NR___syscall_pread __NR_pread
-static __always_inline _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
-			size_t, count, off_t, offset_hi, off_t, offset_lo)
-
-static __always_inline ssize_t
-_dl_pread(int fd, void *buf, size_t count, off_t offset)
-{
-  return(__syscall_pread(fd,buf,count,__LONG_LONG_PAIR (offset >> 31, offset)));
-}
-#endif
-
 #ifdef __NR_sram_alloc
 #define __NR__dl_sram_alloc __NR_sram_alloc
 static __always_inline _syscall2(__ptr_t, _dl_sram_alloc,
diff --git a/ldso/ldso/c6x/dl-syscalls.h b/ldso/ldso/c6x/dl-syscalls.h
index 66d96ab..f40c4fd 100644
--- a/ldso/ldso/c6x/dl-syscalls.h
+++ b/ldso/ldso/c6x/dl-syscalls.h
@@ -1,17 +1 @@
-/* Copyright (C) 2010 Texas Instruments Incorporated
- * Contributed by Mark Salter <msalter at redhat.com>
- *
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-#ifdef __NR_pread64
-#define __NR___syscall_pread __NR_pread64
-static __always_inline _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
-			size_t, count, off_t, offset_hi, off_t, offset_lo);
-
-static __always_inline ssize_t
-_dl_pread(int fd, void *buf, size_t count, off_t offset)
-{
-  return(__syscall_pread(fd,buf,count, offset, offset >> 31));
-}
-#endif
+/* stub for arch-specific syscall issues */
diff --git a/ldso/ldso/frv/dl-syscalls.h b/ldso/ldso/frv/dl-syscalls.h
index ce9435a..f40c4fd 100644
--- a/ldso/ldso/frv/dl-syscalls.h
+++ b/ldso/ldso/frv/dl-syscalls.h
@@ -1,17 +1 @@
-/* Copyright (C) 2003, 2004 Red Hat, Inc.
- * Contributed by Alexandre Oliva <aoliva at redhat.com>
- *
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-#ifdef __NR_pread
-#define __NR___syscall_pread __NR_pread
-static __always_inline _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
-			size_t, count, off_t, offset_hi, off_t, offset_lo);
-
-static __always_inline ssize_t
-_dl_pread(int fd, void *buf, size_t count, off_t offset)
-{
-  return(__syscall_pread(fd,buf,count,__LONG_LONG_PAIR (offset >> 31, offset)));
-}
-#endif
+/* stub for arch-specific syscall issues */


More information about the uClibc-cvs mailing list