// Copyright 2016 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.// +build openbsd// +build 386 amd64 armpackageuniximport("syscall""unsafe")const(SYS_PLEDGE=108)// Pledge implements the pledge syscall. For more information see pledge(2).funcPledge(promisesstring,paths[]string)error{promisesPtr,err:=syscall.BytePtrFromString(promises)iferr!=nil{returnerr}promisesUnsafe,pathsUnsafe:=unsafe.Pointer(promisesPtr),unsafe.Pointer(nil)ifpaths!=nil{varpathsPtr[]*byteifpathsPtr,err=syscall.SlicePtrFromStrings(paths);err!=nil{returnerr}pathsUnsafe=unsafe.Pointer(&pathsPtr[0])}_,_,e:=syscall.Syscall(SYS_PLEDGE,uintptr(promisesUnsafe),uintptr(pathsUnsafe),0)ife!=0{returne}returnnil}