shithub: mc

Download patch

ref: 2187a32156c6d7094cb3be64f7a249d456537fb4
parent: 11ff08b7c5d3d682628b27e0a37b9d7e4deb28b7
author: Ori Bernstein <[email protected]>
date: Mon Aug 11 18:16:16 EDT 2014

Implement waitstatus() for freebsd.

--- a/libstd/waitstatus-freebsd.myr
+++ b/libstd/waitstatus-freebsd.myr
@@ -1,0 +1,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")
+}