shithub: mc

ref: b31626248ea64c23d2020846e2cac1c751348b61
dir: /lib/std/pledge+openbsd.myr/

View raw version
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
	;;
}