summary refs log tree commit diff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2002-12-21 20:09:41 +0000
committerAndreas Schwab <schwab@suse.de>2002-12-21 20:09:41 +0000
commit9ff11db453caef3db334ace74cc2b579ff7cccfa (patch)
tree1438719cbb887d31975dcc5af8409c6cee96f313 /sysdeps/unix
parent257757f8b032bd2913db107b7bbfa76cbce6f9d1 (diff)
downloadglibc-9ff11db453caef3db334ace74cc2b579ff7cccfa.tar.gz
glibc-9ff11db453caef3db334ace74cc2b579ff7cccfa.tar.xz
glibc-9ff11db453caef3db334ace74cc2b579ff7cccfa.zip
*** empty log message ***
	(SYSCALL_ERROR_HANDLER): Define RTLD_PRIVATE_ERRNO variant.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/m68k/brk.c2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sysdep.h28
2 files changed, 23 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/m68k/brk.c b/sysdeps/unix/sysv/linux/m68k/brk.c
index adf6c64854..396b97d945 100644
--- a/sysdeps/unix/sysv/linux/m68k/brk.c
+++ b/sysdeps/unix/sysv/linux/m68k/brk.c
@@ -33,7 +33,7 @@ __brk (void *addr)
 {
   void *newbrk;
 
-  newbrk = INTERNAL_SYSCALL (brk, 1, addr);
+  newbrk = (void *) INTERNAL_SYSCALL (brk, 1, addr);
   __curbrk = newbrk;
 
   if (newbrk < addr)
diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h
index 005e60ffe1..06033f4756 100644
--- a/sysdeps/unix/sysv/linux/m68k/sysdep.h
+++ b/sysdeps/unix/sysv/linux/m68k/sysdep.h
@@ -21,6 +21,9 @@
 #include <sysdeps/unix/sysdep.h>
 #include <sysdeps/m68k/sysdep.h>
 
+/* Defines RTLD_PRIVATE_ERRNO.  */
+#include <dl-sysdep.h>
+
 /* For Linux we can use the system call table in the header file
 	/usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax
@@ -66,9 +69,21 @@
   END (name)
 
 #ifdef PIC
+# ifdef RTLD_PRIVATE_ERRNO
+#  define SYSCALL_ERROR_HANDLER						      \
+SYSCALL_ERROR_LABEL:							      \
+    lea (errno, %pc), %a0;					      	      \
+    neg.l %d0;								      \
+    move.l %d0, (%a0);							      \
+    move.l &-1, %d0;							      \
+    /* Copy return value to %a0 for syscalls that are declared to return      \
+       a pointer (e.g., mmap).  */					      \
+    move.l %d0, %a0;							      \
+    rts;
+# else /* !RTLD_PRIVATE_ERRNO */
 /* Store (- %d0) into errno through the GOT.  */
-#ifdef _LIBC_REENTRANT
-#define SYSCALL_ERROR_HANDLER						      \
+#  if defined _LIBC_REENTRANT
+#  define SYSCALL_ERROR_HANDLER						      \
 SYSCALL_ERROR_LABEL:							      \
     neg.l %d0;								      \
     move.l %d0, -(%sp);							      \
@@ -79,8 +94,8 @@ SYSCALL_ERROR_LABEL:							      \
        a pointer (e.g., mmap).  */					      \
     move.l %d0, %a0;							      \
     rts;
-#else /* !_LIBC_REENTRANT */
-#define SYSCALL_ERROR_HANDLER						      \
+#  else /* !_LIBC_REENTRANT */
+#  define SYSCALL_ERROR_HANDLER						      \
 SYSCALL_ERROR_LABEL:							      \
     move.l (errno@GOTPC, %pc), %a0;					      \
     neg.l %d0;								      \
@@ -90,9 +105,10 @@ SYSCALL_ERROR_LABEL:							      \
        a pointer (e.g., mmap).  */					      \
     move.l %d0, %a0;							      \
     rts;
-#endif /* _LIBC_REENTRANT */
+#  endif /* _LIBC_REENTRANT */
+# endif /* RTLD_PRIVATE_ERRNO */
 #else
-#define SYSCALL_ERROR_HANDLER	/* Nothing here; code in sysdep.S is used.  */
+# define SYSCALL_ERROR_HANDLER	/* Nothing here; code in sysdep.S is used.  */
 #endif /* PIC */
 
 /* Linux takes system call arguments in registers: