Declare OpenBSD pledge(2) (#5)

This commit is contained in:
Maxim Baz
2018-04-12 23:37:59 +02:00
committed by GitHub
parent 90ca691ac9
commit b0f774585c
4 changed files with 27 additions and 6 deletions

7
openbsd/generic.go Normal file
View File

@@ -0,0 +1,7 @@
// +build !openbsd
package openbsd
// Pledge allowed system calls, available only on OpenBSD systems
func Pledge(promises string) {
}

10
openbsd/openbsd.go Normal file
View File

@@ -0,0 +1,10 @@
// +build openbsd
package openbsd
import "golang.org/x/sys/unix"
// Pledge allowed system calls
func Pledge(promises string) {
unix.Pledge(promises, nil)
}