raz / test / err / lib / Rt.raz

25 lines · 584 B · raw · history · last change 26da1860

1(* An Rt for test/err/RtPair: exit and fail, and `calls` with no
2 `teller` to be given its address, which the compiler refuses. *)
3module Rt;
4import SYSTEM;
5
6const ExitGroup = 231; (* Linux's exit_group(status) *)
7
8(* Ends the program with status *)
9proc exit*(status: INT);
10begin
11 _ := SYSTEM.SYSCALL(ExitGroup, status);
12end;
13
14(* A check failed; this Rt ends the program *)
15proc fail*(_what, _a, _b, _len: INT; _at: UINT; _name: ^U8; _rdi, _rsi: UINT);
16begin
17 exit(2);
18end;
19
20(* Says the calls under way: the half of a pair that is alone *)
21proc calls*;
22begin
23end;
24
25end Rt.