mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: Madvise and Mprotect for Linux.
R=rsc CC=golang-dev https://golang.org/cl/4369047
This commit is contained in:
parent
a260de44e9
commit
946a4ea0e3
4 changed files with 87 additions and 1 deletions
|
|
@ -773,6 +773,34 @@ func munmap(addr uintptr, length uintptr) (errno int) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Madvise(b []byte, advice int) (errno int) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))
|
||||
errno = int(e1)
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mprotect(b []byte, prot int) (errno int) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
|
||||
errno = int(e1)
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, errno int) {
|
||||
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
||||
fd = int(r0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue