Commit 839e9ead authored by Albert Strasheim's avatar Albert Strasheim Committed by Brad Fitzpatrick

syscall: Mlock, Munlock, Mlockall, Munlockall on Linux.

R=rsc, bradfitzgo
CC=golang-dev
https://golang.org/cl/4433070
parent e2f9c733
...@@ -814,8 +814,12 @@ func Munmap(b []byte) (errno int) { ...@@ -814,8 +814,12 @@ func Munmap(b []byte) (errno int) {
return mapper.Munmap(b) return mapper.Munmap(b)
} }
//sys Madvise(b []byte, advice int) (errno int) //sys Madvise(b []byte, advice int) (errno int)
//sys Mprotect(b []byte, prot int) (errno int) //sys Mprotect(b []byte, prot int) (errno int)
//sys Mlock(b []byte) (errno int)
//sys Munlock(b []byte) (errno int)
//sys Mlockall(flags int) (errno int)
//sys Munlockall() (errno int)
/* /*
* Unimplemented * Unimplemented
...@@ -874,8 +878,6 @@ func Munmap(b []byte) (errno int) { ...@@ -874,8 +878,6 @@ func Munmap(b []byte) (errno int) {
// Mbind // Mbind
// MigratePages // MigratePages
// Mincore // Mincore
// Mlock
// Mmap
// ModifyLdt // ModifyLdt
// Mount // Mount
// MovePages // MovePages
...@@ -892,9 +894,6 @@ func Munmap(b []byte) (errno int) { ...@@ -892,9 +894,6 @@ func Munmap(b []byte) (errno int) {
// Msgrcv // Msgrcv
// Msgsnd // Msgsnd
// Msync // Msync
// Munlock
// Munlockall
// Munmap
// Newfstatat // Newfstatat
// Nfsservctl // Nfsservctl
// Personality // Personality
......
...@@ -801,6 +801,50 @@ func Mprotect(b []byte, prot int) (errno int) { ...@@ -801,6 +801,50 @@ func Mprotect(b []byte, prot int) (errno int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mlock(b []byte) (errno int) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
errno = int(e1)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Munlock(b []byte) (errno int) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
errno = int(e1)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mlockall(flags int) (errno int) {
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
errno = int(e1)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Munlockall() (errno int) {
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
errno = int(e1)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Chown(path string, uid int, gid int) (errno int) { func Chown(path string, uid int, gid int) (errno int) {
_, _, e1 := Syscall(SYS_CHOWN32, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid)) _, _, e1 := Syscall(SYS_CHOWN32, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
errno = int(e1) errno = int(e1)
......
...@@ -801,6 +801,50 @@ func Mprotect(b []byte, prot int) (errno int) { ...@@ -801,6 +801,50 @@ func Mprotect(b []byte, prot int) (errno int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mlock(b []byte) (errno int) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
errno = int(e1)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Munlock(b []byte) (errno int) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
errno = int(e1)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mlockall(flags int) (errno int) {
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
errno = int(e1)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Munlockall() (errno int) {
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
errno = int(e1)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Chown(path string, uid int, gid int) (errno int) { func Chown(path string, uid int, gid int) (errno int) {
_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid)) _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
errno = int(e1) errno = int(e1)
......
...@@ -801,6 +801,50 @@ func Mprotect(b []byte, prot int) (errno int) { ...@@ -801,6 +801,50 @@ func Mprotect(b []byte, prot int) (errno int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mlock(b []byte) (errno int) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
errno = int(e1)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Munlock(b []byte) (errno int) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
errno = int(e1)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mlockall(flags int) (errno int) {
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
errno = int(e1)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Munlockall() (errno int) {
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
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) { 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))) r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0) fd = int(r0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment