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
946a4ea0
Commit
946a4ea0
authored
Apr 21, 2011
by
Albert Strasheim
Committed by
Russ Cox
Apr 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall: Madvise and Mprotect for Linux.
R=rsc CC=golang-dev
https://golang.org/cl/4369047
parent
a260de44
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
1 deletion
+87
-1
syscall_linux.go
src/pkg/syscall/syscall_linux.go
+3
-1
zsyscall_linux_386.go
src/pkg/syscall/zsyscall_linux_386.go
+28
-0
zsyscall_linux_amd64.go
src/pkg/syscall/zsyscall_linux_amd64.go
+28
-0
zsyscall_linux_arm.go
src/pkg/syscall/zsyscall_linux_arm.go
+28
-0
No files found.
src/pkg/syscall/syscall_linux.go
View file @
946a4ea0
...
@@ -814,6 +814,9 @@ func Munmap(b []byte) (errno int) {
...
@@ -814,6 +814,9 @@ func Munmap(b []byte) (errno int) {
return
mapper
.
Munmap
(
b
)
return
mapper
.
Munmap
(
b
)
}
}
//sys Madvise(b []byte, advice int) (errno int)
//sys Mprotect(b []byte, prot int) (errno int)
/*
/*
* Unimplemented
* Unimplemented
*/
*/
...
@@ -868,7 +871,6 @@ func Munmap(b []byte) (errno int) {
...
@@ -868,7 +871,6 @@ func Munmap(b []byte) (errno int) {
// LookupDcookie
// LookupDcookie
// Lremovexattr
// Lremovexattr
// Lsetxattr
// Lsetxattr
// Madvise
// Mbind
// Mbind
// MigratePages
// MigratePages
// Mincore
// Mincore
...
...
src/pkg/syscall/zsyscall_linux_386.go
View file @
946a4ea0
...
@@ -773,6 +773,34 @@ func munmap(addr uintptr, length uintptr) (errno int) {
...
@@ -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
// 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
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
)
...
...
src/pkg/syscall/zsyscall_linux_amd64.go
View file @
946a4ea0
...
@@ -773,6 +773,34 @@ func munmap(addr uintptr, length uintptr) (errno int) {
...
@@ -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
// 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
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
)
...
...
src/pkg/syscall/zsyscall_linux_arm.go
View file @
946a4ea0
...
@@ -773,6 +773,34 @@ func munmap(addr uintptr, length uintptr) (errno int) {
...
@@ -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
// 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
)
{
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
)
...
...
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