ref: 92840bc1ade4d670ce1b6cd3dc7be48b16148a5e
parent: 3d9e396e9696c1aa2290fce09626c33d15e1ea03
author: Ori Bernstein <[email protected]>
date: Fri Jun 8 04:10:35 EDT 2018
Add pledge support.
--- a/lib/std/bld.sub
+++ b/lib/std/bld.sub
@@ -86,6 +86,9 @@
varargs.myr
writeall.myr
+ pledge.myr
+ pledge+openbsd.myr
+
# asm optimizations
memops.myr
memops-impl.myr
--- /dev/null
+++ b/lib/std/pledge+openbsd.myr
@@ -1,0 +1,9 @@
+use sys
+
+pkg std =
+ const pledge : (promise : byte[:], epromise : byte[:] -> void)
+;;
+
+const pledge = {promise, epromise
+ sys.pledge(sys.cstring(promise), sys.cstring(epromise))
+}
--- /dev/null
+++ b/lib/std/pledge.myr
@@ -1,0 +1,8 @@
+use sys
+
+pkg std =
+ const pledge : (promise : byte[:], epromise : byte[:] -> void)
+;;
+
+const pledge = {promise, epromise
+}