mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-28 04:46:44 -04:00
unix: don't use local syscall number in Pledge()
Change-Id: Ifecafeedd733d4b33ef082a8f505165de9bac20a GitHub-Last-Rev: 44c40b042479bb3a4a73838b2536adbb715cde11 GitHub-Pull-Request: golang/sys#20 Reviewed-on: https://go-review.googlesource.com/c/142318 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
committed by
Tobias Klauser
parent
5535b4e6bf
commit
8b8824e799
@@ -15,10 +15,6 @@ import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
_SYS_PLEDGE = 108
|
||||
)
|
||||
|
||||
// Pledge implements the pledge syscall.
|
||||
//
|
||||
// The pledge syscall does not accept execpromises on OpenBSD releases
|
||||
@@ -63,7 +59,7 @@ func Pledge(promises, execpromises string) error {
|
||||
expr = unsafe.Pointer(exptr)
|
||||
}
|
||||
|
||||
_, _, e := syscall.Syscall(_SYS_PLEDGE, uintptr(unsafe.Pointer(pptr)), uintptr(expr), 0)
|
||||
_, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(unsafe.Pointer(pptr)), uintptr(expr), 0)
|
||||
if e != 0 {
|
||||
return e
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user