shithub: gover

ref: 5968bd41c7e89461fec41a3b669514a89ddbda10
dir: /protect_openbsd.go/

View raw version
package main

import (
	"log"

	"golang.org/x/sys/unix"
)

func pledge(promises string) {
	err := unix.PledgePromises(promises)
	if err != nil {
		log.Fatal(err)
	}
}

func unveil(path string, flags string) {
	err := unix.Unveil(path, flags)
	if err != nil {
		log.Fatal(err)
	}
}

func unveilBlock() {
	err := unix.UnveilBlock()
	if err != nil {
		log.Fatal(err)
	}
}