LABEL(x); \
BODY(x)
-#define BODY(x) \
+#define BODY1(x) \
sys_call(x); \
ta %g0; \
bgeu 0f; \
or %o5, %lo(cerror), %o5; \
jmp %o5; \
nop; \
-0:; \
+0:;
+#define BODY(x) \
+ BODY1(x) \
retl; \
nop
#include "SYS.h"
-SYS_call_0(fork)
+LABEL_(fork); BODY1(fork)
+ orcc %g0, %o1, %g0
+ bne,a 1f
+ clr %o0
+1:
+ retl
+ nop
call %g2
nop
+ add %fp, %g4, %sp ! cannot trust %sp after call
ld [%fp + 0x5c], %o3
ld [%fp + 0x58], %i0
ld [%sp + 0xe4], %l1
#define SYS_write 4
#define SYS_open 5
#define SYS_close 6
+#define SYS_wait4 7
#define SYS_creat 8
#define SYS_link 9
#define SYS_unlink 10
#define SYS_getpgrp 81
#define SYS_setpgrp 82
#define SYS_setitimer 83
-#define SYS_wait4 84
#define SYS_swapon 85
#define SYS_getitimer 86
#define SYS_gethostname 87