shithub: mc

Download patch

ref: dff9fe20898ba0d2165dd55b2e47486acbef45c1
parent: 177fc54cd73b3462a43da1cac81703945b7d0897
author: Ori Bernstein <ori@eigenstate.org>
date: Tue May 3 06:11:35 EDT 2016

Add in support for bsdthread_register.

    Is this correct?

--- a/lib/sys/sys+osx-x64.myr
+++ b/lib/sys/sys+osx-x64.myr
@@ -690,6 +690,7 @@
 	const execve	: (cmd : byte[:], args : byte[:][:], env : byte[:][:] -> int64)
 	/* wrappers to extract wait status */
 	const waitstatus	: (st : int32 -> waitstatus)
+	const bsdthread_register	: (start : void#, wqthread : void#, sz : uint32, dummy : uint32, targetconc : void#, queueoff : uint32 -> int)
 	const bsdthread_create	: (func : void#, arg : void#, stk : void#, pthr : void#, flags : uint32 -> void#)
 	const bsdthread_terminate	: (stk : void#, len : size, port : machport, sem : machport -> int)
 
@@ -788,6 +789,16 @@
 const wait4	= {pid, loc, opt, rusage;	-> syscall(Syswait4, a(pid), a(loc), a(opt), a(rusage))}
 const waitpid	= {pid, loc, opt;
 	-> wait4(pid, loc, opt, 0 castto(rusage#))
+}
+
+const bsdthread_register = {start, wqthread, sz, dummy, targetconc, queueoff
+	-> syscall(Sysbsdthread_register, \
+		a(start), \
+		a(wqthread), \
+		a(sz), \
+		a(dummy), \
+		a(targetconc), \
+		a(queueoff)) castto(int)
 }
 
 const bsdthread_create	= {func , arg , stk , pthr , flags