зеркало из https://github.com/golang/sys.git
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:
Родитель
5535b4e6bf
Коммит
8b8824e799
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче