]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: Mlock, Munlock, Mlockall, Munlockall on Linux.
authorAlbert Strasheim <fullung@gmail.com>
Tue, 26 Apr 2011 13:41:19 +0000 (06:41 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 26 Apr 2011 13:41:19 +0000 (06:41 -0700)
R=rsc, bradfitzgo
CC=golang-dev
https://golang.org/cl/4433070

src/pkg/syscall/syscall_linux.go
src/pkg/syscall/zsyscall_linux_386.go
src/pkg/syscall/zsyscall_linux_amd64.go
src/pkg/syscall/zsyscall_linux_arm.go

index e5f1e78d43daec4b1ed780eed095bc705c964973..4a3797c20c4b4c51269d48e08793512d9291dfb4 100644 (file)
@@ -814,8 +814,12 @@ func Munmap(b []byte) (errno int) {
        return mapper.Munmap(b)
 }
 
-//sys  Madvise(b []byte, advice int) (errno int) 
-//sys  Mprotect(b []byte, prot int) (errno int) 
+//sys  Madvise(b []byte, advice 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
@@ -874,8 +878,6 @@ func Munmap(b []byte) (errno int) {
 // Mbind
 // MigratePages
 // Mincore
-// Mlock
-// Mmap
 // ModifyLdt
 // Mount
 // MovePages
@@ -892,9 +894,6 @@ func Munmap(b []byte) (errno int) {
 // Msgrcv
 // Msgsnd
 // Msync
-// Munlock
-// Munlockall
-// Munmap
 // Newfstatat
 // Nfsservctl
 // Personality
index 855e10e824fa7f3c3f23aec2bdf9cb4af236756d..4f331aa226057299c82103f342e8d4a234058d90 100644 (file)
@@ -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
 
+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) {
        _, _, e1 := Syscall(SYS_CHOWN32, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
        errno = int(e1)
index 322be7e1d128a9c380bb3a583504dc46b90b5ead..19501dbfa58fcef6629ee0262cbc1921b5f9c7b6 100644 (file)
@@ -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
 
+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) {
        _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid))
        errno = int(e1)
index f41240d5c4663a2448a38cf471233b115a0a175c..db49b64829f47b45ed3458360a155534a494fd9e 100644 (file)
@@ -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
 
+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) {
        r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
        fd = int(r0)