Index: amd64/SYS.h
===================================================================
RCS file: /home/ncvs/src/lib/libc/amd64/SYS.h,v
retrieving revision 1.27
diff -u -r1.27 SYS.h
--- amd64/SYS.h	22 Feb 2004 02:11:39 -0000	1.27
+++ amd64/SYS.h	3 May 2008 09:11:50 -0000
@@ -48,6 +48,12 @@
 			.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
 			mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \
 			2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx
+
+#define	PSEUDO(x)	ENTRY(__CONCAT(__sys_,x));			\
+			.weak CNAME(__CONCAT(_,x));			\
+			.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
+			mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret ; \
+			2: movq PIC_GOT(HIDENAME(cerror)),%rcx; jmp *%rcx
 #else
 #define	RSYSCALL(x)	ENTRY(__CONCAT(__sys_,x));			\
 			.weak CNAME(x);					\
@@ -56,11 +62,12 @@
 			.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
 			mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \
 			2: jmp HIDENAME(cerror)
-#endif
 
 #define	PSEUDO(x)	ENTRY(__CONCAT(__sys_,x));			\
 			.weak CNAME(__CONCAT(_,x));			\
 			.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
-			mov __CONCAT($SYS_,x),%rax; KERNCALL; ret
+			mov __CONCAT($SYS_,x),%rax; KERNCALL; jb 2f; ret; \
+			2: jmp HIDENAME(cerror)
+#endif
 
 #define KERNCALL	movq %rcx, %r10; syscall
Index: arm/SYS.h
===================================================================
RCS file: /home/ncvs/src/lib/libc/arm/SYS.h,v
retrieving revision 1.2
diff -u -r1.2 SYS.h
--- arm/SYS.h	9 Nov 2004 16:49:13 -0000	1.2
+++ arm/SYS.h	3 May 2008 09:16:25 -0000
@@ -65,26 +65,19 @@
 	_SYSCALL_NOERROR(x);						\
 	bcs PIC_SYM(CERROR, PLT)
 
-#define SYSCALL_NOERROR(x)						\
-	_SYSCALL_NOERROR(x)
-
 #define SYSCALL(x)							\
 	_SYSCALL(x)
 
-
-#define PSEUDO_NOERROR(x)						\
-	_SYSCALL_NOERROR(x);						\
-	RET
-
 #define PSEUDO(x)							\
-	_SYSCALL(x);							\
+	ENTRY(__CONCAT(__sys_, x));					\
+	.weak _C_LABEL(__CONCAT(_,x));					\
+	.set _C_LABEL(__CONCAT(_,x)),_C_LABEL(__CONCAT(__sys_,x));	\
+	SYSTRAP(x);							\
+	bcs PIC_SYM(CERROR, PLT);					\
 	RET
 
-
-#define RSYSCALL_NOERROR(x)						\
-	PSEUDO_NOERROR(x)
-
 #define RSYSCALL(x)							\
-	PSEUDO(x)
+	_SYSCALL(x);							\
+	RET
 
 	.globl  CERROR
Index: i386/SYS.h
===================================================================
RCS file: /home/ncvs/src/lib/libc/i386/SYS.h,v
retrieving revision 1.24
diff -u -r1.24 SYS.h
--- i386/SYS.h	17 Sep 2002 01:48:51 -0000	1.24
+++ i386/SYS.h	3 May 2008 09:07:50 -0000
@@ -50,10 +50,11 @@
 
 #define	RSYSCALL(x)	SYSCALL(x); ret
 
-#define	PSEUDO(x)	ENTRY(__CONCAT(__sys_,x));			\
+#define	PSEUDO(x)	2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \
+			ENTRY(__CONCAT(__sys_,x));			\
 			.weak CNAME(__CONCAT(_,x));			\
 			.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
-			mov __CONCAT($SYS_,x),%eax; KERNCALL; ret
+			mov __CONCAT($SYS_,x),%eax; KERNCALL; jb 2b; ret
 
 /* gas messes up offset -- although we don't currently need it, do for BCS */
 #define	LCALL(x,y)	.byte 0x9a ; .long y; .word x
Index: sparc64/SYS.h
===================================================================
RCS file: /home/ncvs/src/lib/libc/sparc64/SYS.h,v
retrieving revision 1.4
diff -u -r1.4 SYS.h
--- sparc64/SYS.h	22 Mar 2002 23:41:58 -0000	1.4
+++ sparc64/SYS.h	3 May 2008 09:12:52 -0000
@@ -82,8 +82,7 @@
 	.weak	CNAME(__CONCAT(_,x)) ; \
 	.type	CNAME(__CONCAT(_,x)),@function ; \
 	.set	CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)) ; \
-	mov	__CONCAT(SYS_,x), %g1 ; \
-	ta	%xcc, ST_SYSCALL ; \
+	_SYSCALL(x) ; \
 	retl ; \
 	 nop ; \
 	.size	CNAME(__CONCAT(__sys_,x)), . - CNAME(__CONCAT(__sys_,x)) ; \
