summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/std/bld.sub3
-rw-r--r--lib/std/pledge+openbsd.myr9
-rw-r--r--lib/std/pledge.myr8
3 files changed, 20 insertions, 0 deletions
diff --git a/lib/std/bld.sub b/lib/std/bld.sub
index e6e8b73..093e242 100644
--- a/lib/std/bld.sub
+++ b/lib/std/bld.sub
@@ -86,6 +86,9 @@ lib std =
varargs.myr
writeall.myr
+ pledge.myr
+ pledge+openbsd.myr
+
# asm optimizations
memops.myr
memops-impl.myr
diff --git a/lib/std/pledge+openbsd.myr b/lib/std/pledge+openbsd.myr
new file mode 100644
index 0000000..dde6841
--- /dev/null
+++ b/lib/std/pledge+openbsd.myr
@@ -0,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))
+}
diff --git a/lib/std/pledge.myr b/lib/std/pledge.myr
new file mode 100644
index 0000000..4e58661
--- /dev/null
+++ b/lib/std/pledge.myr
@@ -0,0 +1,8 @@
+use sys
+
+pkg std =
+ const pledge : (promise : byte[:], epromise : byte[:] -> void)
+;;
+
+const pledge = {promise, epromise
+}