summaryrefslogtreecommitdiff
path: root/lib/std/pledge+openbsd.myr
blob: 762b6f1d70e260bdc0cb0a34ad3d1d7cb34b8f48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use sys
use "errno"
use "result"

pkg std =
	const pledge	: (promise : byte[:], epromise : byte[:] -> result(void, errno))
;;

const pledge = {promise, epromise
	var r

	r = sys.pledge(sys.cstring(promise), sys.cstring(epromise))
	if r < 0
		-> `std.Err (r : errno)
	else
		-> `std.Ok void
	;;
}