shithub: mc

Download patch

ref: 7ef538ccbcd502a6fe960509c26bca568d94c6a7
parent: 5a07a949b3667e0f0b97156035104d35f6aea2a5
author: Ori Bernstein <[email protected]>
date: Thu Jan 9 06:28:50 EST 2014

Wait statuses are 32 bit ints, not 64 bit ints.

    Fix ABI issue.

--- a/libstd/sys-linux.myr
+++ b/libstd/sys-linux.myr
@@ -457,8 +457,8 @@
 	const getpid	: ( -> int64)
 	const kill	: (pid:int64, sig:int64 -> int64)
 	const fork	: (-> int64)
-	const wait4	: (pid:int64, loc:int64#, opt : int64, usage:rusage#	-> int64)
-	const waitpid	: (pid:int64, loc:int64#, opt : int64	-> int64)
+	const wait4	: (pid:int64, loc:int32#, opt : int64, usage:rusage#	-> int64)
+	const waitpid	: (pid:int64, loc:int32#, opt : int64	-> int64)
 	const execv	: (cmd : byte[:], args : byte[:][:] -> int64)
 	const execve	: (cmd : byte[:], args : byte[:][:], env : byte[:][:] -> int64)
 
--- a/libstd/sys-osx.myr
+++ b/libstd/sys-osx.myr
@@ -492,8 +492,8 @@
 	const getpid	: ( -> int64)
 	const kill	: (pid:int64, sig:int64 -> int64)
 	const fork	: (-> int64)
-	const wait4	: (pid:int64, loc:int64#, opt : int64, usage:rusage#	-> int64)
-	const waitpid	: (pid:int64, loc:int64#, opt : int64	-> int64)
+	const wait4	: (pid:int64, loc:int32#, opt : int64, usage:rusage#	-> int64)
+	const waitpid	: (pid:int64, loc:int32#, opt : int64	-> int64)
 	const execv	: (cmd : byte[:], args : byte[:][:] -> int64)
 	const execve	: (cmd : byte[:], args : byte[:][:], env : byte[:][:] -> int64)
 
@@ -538,8 +538,7 @@
 const fork	= {;			-> syscall(Sysfork)}
 const wait4	= {pid, loc, opt, usage;	-> syscall(Syswait4, pid, loc, opt, usage)}
 const waitpid	= {pid, loc, opt;
-	var rusage
-	-> wait4(pid, loc, opt, &rusage)
+	-> wait4(pid, loc, opt, 0 castto(byte#)) 
 }
 
 const execv	= {cmd, args
--- a/libstd/waitstatus-linux.myr
+++ b/libstd/waitstatus-linux.myr
@@ -1,12 +1,12 @@
 use "die.use"
 pkg std =
 	type waitstatus = union
-		`Waitexit int64
-		`Waitsig  int64
-		`Waitstop int64
+		`Waitexit int32
+		`Waitsig  int32
+		`Waitstop int32
 	;;
 
-	const waitstatus	: (st : int64 -> waitstatus)
+	const waitstatus	: (st : int32 -> waitstatus)
 ;;
 
 const waitstatus = {st
--- a/libstd/waitstatus-osx.myr
+++ b/libstd/waitstatus-osx.myr
@@ -1,12 +1,12 @@
 use "die.use"
 pkg std =
 	type waitstatus = union
-		`Waitexit int64
-		`Waitsig  int64
-		`Waitstop int64
+		`Waitexit int32
+		`Waitsig  int32
+		`Waitstop int32
 	;;
 
-	const waitstatus	: (st : int64 -> waitstatus)
+	const waitstatus	: (st : int32 -> waitstatus)
 ;;
 
 const waitstatus = {st