shithub: mc

ref: 0c69c0abbe786ded8ec894bb93f7b30960159a33
dir: /libstd/waitstatus+freebsd.myr/

View raw version
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")
}