summaryrefslogtreecommitdiff
path: root/lib/libc/arch/sparc
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-09-20 20:52:11 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-09-20 20:52:11 +0000
commit4e9408f19825cf62714518d8932f18563b44cd7b (patch)
treea6b52feaebb23e89ad560dfbf6a01b67e80c9b11 /lib/libc/arch/sparc
parentbca0bac323557ad790813fb7c2d4e2539df9193d (diff)
Add PSEUDO_NOERROR similar to that used by NetBSD.
Some ports were setting errno in PSEUDO and some were not. Now errno is set for all in PSEUDO and PSEUDO_NOERROR is provided for the non-errno case (only used by _exit). Needs testing on vax and m88k. XXX - hppa and powerpc still lack a real PSEUDO_NOERROR implementation. Currently PSEUDO_NOERROR and PSEUDO are the same (so builds don't break on those platforms).
Diffstat (limited to 'lib/libc/arch/sparc')
-rw-r--r--lib/libc/arch/sparc/SYS.h27
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/libc/arch/sparc/SYS.h b/lib/libc/arch/sparc/SYS.h
index 3f6fe17100f..cfaefa3805c 100644
--- a/lib/libc/arch/sparc/SYS.h
+++ b/lib/libc/arch/sparc/SYS.h
@@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: SYS.h,v 1.8 2001/08/12 12:03:01 heko Exp $
+ * $OpenBSD: SYS.h,v 1.9 2001/09/20 20:52:10 millert Exp $
*/
#include <machine/asm.h>
@@ -86,23 +86,32 @@
__ENTRY(p,x); mov (_CAT(SYS_,y))|SYSCALL_G2RFLAG,%g1; add %o7,8,%g2; \
t ST_SYSCALL; ERROR()
+/*
+ * PSEUDO_NOERROR(x,y) is like PSEUDO(x,y) except that errno is not set.
+ */
+#define __PSEUDO_NOERROR(p,x,y) \
+ __ENTRY(p,x); mov (_CAT(SYS_,y))|SYSCALL_G2RFLAG,%g1; add %o7,8,%g2; \
+ t ST_SYSCALL
+
#ifdef _THREAD_SAFE
/*
* For the thread_safe versions, we prepend _thread_sys_ to the function
* name so that the 'C' wrapper can go around the real name.
*/
-# define SYSCALL(x) __SYSCALL(_thread_sys_,x)
-# define RSYSCALL(x) __RSYSCALL(_thread_sys_,x)
-# define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y)
-# define SYSENTRY(x) __ENTRY(_thread_sys_,x)
+# define SYSCALL(x) __SYSCALL(_thread_sys_,x)
+# define RSYSCALL(x) __RSYSCALL(_thread_sys_,x)
+# define PSEUDO(x,y) __PSEUDO(_thread_sys_,x,y)
+# define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(_thread_sys_,x,y)
+# define SYSENTRY(x) __ENTRY(_thread_sys_,x)
#else /* _THREAD_SAFE */
/*
* The non-threaded library defaults to traditional syscalls where
* the function name matches the syscall name.
*/
-# define SYSCALL(x) __SYSCALL(,x)
-# define RSYSCALL(x) __RSYSCALL(,x)
-# define PSEUDO(x,y) __PSEUDO(,x,y)
-# define SYSENTRY(x) __ENTRY(,x)
+# define SYSCALL(x) __SYSCALL(,x)
+# define RSYSCALL(x) __RSYSCALL(,x)
+# define PSEUDO(x,y) __PSEUDO(,x,y)
+# define PSEUDO_NOERROR(x,y) __PSEUDO_NOERROR(,x,y)
+# define SYSENTRY(x) __ENTRY(,x)
#endif /* _THREAD_SAFE */
.globl cerror