diff --git a/src/native/posix/generic/System/Mod/Kernel.cp b/src/native/posix/generic/System/Mod/Kernel.cp
index 986425d7ce5ae66305c5713c3735afd21afedf72..2039e1766ff3b0595b81a696846cc72f4dc58c3a 100644 (file)
MODULE Kernel;
- IMPORT S := SYSTEM, stdlib := C99stdlib, stdio := C99stdio,
- time := C99time, wctype := C99wctype, sysmman := C99sys_mman,
- dlfcn := C99dlfcn, types := C99types, fcntl := C99fcntl,
- unistd := C99unistd, signal := C99signal, setjmp := C99setjmp;
+ IMPORT S := SYSTEM, stdlib := PosixCstdlib, stdio := PosixCstdio,
+ time := PosixCtime, wctype := PosixCwctype, sysmman := PosixCsys_mman,
+ dlfcn := PosixCdlfcn, types := PosixCtypes, fcntl := PosixCfcntl,
+ unistd := PosixCunistd, signal := PosixCsignal, setjmp := PosixCsetjmp;
(* init fpu? *)
(* add signal blocking to avoid race conditions in Try/Trap/TrapHandler *)
wouldFinalize: BOOLEAN;
- watcher*: PROCEDURE (event: INTEGER); (* for debugging *)
+ watcher*: PROCEDURE (event: INTEGER); (* for debugging *)
+
+ intTrap*: BOOLEAN;
PROCEDURE Erase (adr, words: INTEGER);
BEGIN
IF isTry THEN
setjmp._longjmp(tryEnv, 1)
END;
- IF err = 128 THEN (* do nothing *)
+ IF (err = 128) OR (err = 200) & ~intTrap THEN (* do nothing *)
ELSIF (trapViewer # NIL) & (restart # NIL) & ~trapped & ~guarded THEN
trapped := TRUE; trapViewer()
ELSE DefaultTrapViewer
IF isTry THEN
setjmp._longjmp(tryEnv, 1)
END;
- IF err = 128 THEN (* do nothing *)
+ IF (err = 128) OR (err = 200) & ~intTrap THEN (* do nothing *)
ELSIF (trapViewer # NIL) & (restart # NIL) & ~trapped & ~guarded THEN
trapped := TRUE; trapViewer()
ELSE DefaultTrapViewer
PROCEDURE Init;
VAR i: INTEGER;
BEGIN
+ intTrap := TRUE;
pagesize := unistd.sysconf(unistd._SC_PAGESIZE);
(* init heap *)