Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
839e9ead
Commit
839e9ead
authored
Apr 26, 2011
by
Albert Strasheim
Committed by
Brad Fitzpatrick
Apr 26, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall: Mlock, Munlock, Mlockall, Munlockall on Linux.
R=rsc, bradfitzgo CC=golang-dev
https://golang.org/cl/4433070
parent
e2f9c733
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
136 additions
and
5 deletions
+136
-5
syscall_linux.go
src/pkg/syscall/syscall_linux.go
+4
-5
zsyscall_linux_386.go
src/pkg/syscall/zsyscall_linux_386.go
+44
-0
zsyscall_linux_amd64.go
src/pkg/syscall/zsyscall_linux_amd64.go
+44
-0
zsyscall_linux_arm.go
src/pkg/syscall/zsyscall_linux_arm.go
+44
-0
No files found.
src/pkg/syscall/syscall_linux.go
View file @
839e9ead
...
...
@@ -816,6 +816,10 @@ func Munmap(b []byte) (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
...
...
src/pkg/syscall/zsyscall_linux_386.go
View file @
839e9ead
...
...
@@ -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
)
...
...
src/pkg/syscall/zsyscall_linux_amd64.go
View file @
839e9ead
...
...
@@ -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
)
...
...
src/pkg/syscall/zsyscall_linux_arm.go
View file @
839e9ead
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment