summaryrefslogtreecommitdiff
path: root/libstd/waitstatus+freebsd.myr
blob: 2769074f47c56de1441c4e52cad8d741af4e1bd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use "die.use"

pkg std =
	type waitstatus = union
		`Waitexit int32
		`Waitsig  int32
		`Waitstop int32
	;;

	const waitstatus	: (st : int32 -> waitstatus)
;;

const waitstatus = {st
	match st & 0o177
	| 0:	-> `Waitexit (st >> 8)
	| 0x7f:-> `Waitstop (st >> 8)
	| sig: 	-> `Waitsig sig
	;;
	die("unreachable")
}