unix: don't use local syscall number in Pledge()

Change-Id: Ifecafeedd733d4b33ef082a8f505165de9bac20a
GitHub-Last-Rev: 44c40b0424
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:
Ivan Markin 2018-10-21 18:11:50 +00:00 коммит произвёл Tobias Klauser
Родитель 5535b4e6bf
Коммит 8b8824e799
1 изменённых файлов: 1 добавлений и 5 удалений

Просмотреть файл

@ -15,10 +15,6 @@ import (
"unsafe" "unsafe"
) )
const (
_SYS_PLEDGE = 108
)
// Pledge implements the pledge syscall. // Pledge implements the pledge syscall.
// //
// The pledge syscall does not accept execpromises on OpenBSD releases // The pledge syscall does not accept execpromises on OpenBSD releases
@ -63,7 +59,7 @@ func Pledge(promises, execpromises string) error {
expr = unsafe.Pointer(exptr) 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 { if e != 0 {
return e return e
} }