summaryrefslogtreecommitdiff
path: root/lib/libc/arch/i386
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/i386
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/i386')
-rw-r--r--lib/libc/arch/i386/SYS.h33
1 files changed, 23 insertions, 10 deletions
diff --git a/lib/libc/arch/i386/SYS.h b/lib/libc/arch/i386/SYS.h
index 02933b17645..a4d0fe9d6aa 100644
--- a/lib/libc/arch/i386/SYS.h
+++ b/lib/libc/arch/i386/SYS.h
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $OpenBSD: SYS.h,v 1.8 2000/01/06 10:49:20 d Exp $
+ * $OpenBSD: SYS.h,v 1.9 2001/09/20 20:52:09 millert Exp $
*/
#include <machine/asm.h>
@@ -88,25 +88,38 @@
int $0x80
#endif /* ! __STDC__ */
+/* perform a syscall */
+#define _SYSCALL_NOERROR(x,y) \
+ SYSENTRY(x); \
+ __DO_SYSCALL(y);
+
+#define SYSCALL_NOERROR(x) \
+ _SYSCALL_NOERROR(x,x)
+
/* perform a syscall, set errno */
-#define SYSCALL(x) \
+#define _SYSCALL(x,y) \
.text; \
.align 2; \
2: \
jmp PIC_PLT(cerror); \
- SYSENTRY(x); \
- __DO_SYSCALL(x); \
+ _SYSCALL_NOERROR(x,y) \
jc 2b
-/* perform a syscall, set errno, return */
-#define RSYSCALL(x) \
- SYSCALL(x); \
- ret
+#define SYSCALL(x) \
+ _SYSCALL(x,x)
/* perform a syscall, return */
+#define PSEUDO_NOERROR(x,y) \
+ _SYSCALL_NOERROR(x,y); \
+ ret
+
+/* perform a syscall, set errno, return */
#define PSEUDO(x,y) \
- SYSENTRY(x); \
- __DO_SYSCALL(y); \
+ _SYSCALL(x,y); \
ret
+/* perform a syscall with the same name, set errno, return */
+#define RSYSCALL(x) \
+ PSEUDO(x,x);
+
.globl cerror