1 // Copyright 2016 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
6 // +build 386 amd64 arm
19 // Pledge implements the pledge syscall. For more information see pledge(2).
20 func Pledge(promises string, paths []string) error {
21 promisesPtr, err := syscall.BytePtrFromString(promises)
25 promisesUnsafe, pathsUnsafe := unsafe.Pointer(promisesPtr), unsafe.Pointer(nil)
28 if pathsPtr, err = syscall.SlicePtrFromStrings(paths); err != nil {
31 pathsUnsafe = unsafe.Pointer(&pathsPtr[0])
33 _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(promisesUnsafe), uintptr(pathsUnsafe), 0)