xref: /inferno-os/module/exception.m (revision 46439007cf417cbd9ac8049bb4122c890097a0fa)
1*46439007SCharles.ForsythException: module{
2*46439007SCharles.Forsyth
3*46439007SCharles.Forsyth	PATH:	con "/dis/lib/exception.dis";
4*46439007SCharles.Forsyth
5*46439007SCharles.Forsyth	# returns the last exception in the form pc, module, exception
6*46439007SCharles.Forsyth	# on the process with the given pid (-1 gives current process)
7*46439007SCharles.Forsyth	# returns (0, nil, nil) if no exception
8*46439007SCharles.Forsyth	getexc:	fn(pid: int): (int, string, string);
9*46439007SCharles.Forsyth
10*46439007SCharles.Forsyth	NOTIFYLEADER, PROPAGATE: con iota;
11*46439007SCharles.Forsyth
12*46439007SCharles.Forsyth	# set the exception mode(NOTIFYLEADER or PROPAGATE)
13*46439007SCharles.Forsyth	# on the current process
14*46439007SCharles.Forsyth	# it is assumed that the process is a group leader (see Sys->NEWPGRP)
15*46439007SCharles.Forsyth	# returns -1 on failure, 0 on success
16*46439007SCharles.Forsyth	setexcmode:	fn(mode: int): int;
17*46439007SCharles.Forsyth
18*46439007SCharles.Forsyth};
19