shithub: mc

ref: f8040a2ba54ace38a662e104fb677dc72da6d647
dir: /libstd/waitstatus-osx.myr/

View raw version
use "die.use"
pkg std =
	type waitstatus = union
		`Waitexit int64
		`Waitsig  int64
		`Waitstop int64
	;;

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

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