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
da5e962e
Commit
da5e962e
authored
Jun 17, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shuffle some Linux system calls around for 386
R=r DELTA=37 (17 added, 15 deleted, 5 changed) OCL=30428 CL=30444
parent
8522a478
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
18 deletions
+20
-18
syscall_linux.go
src/pkg/syscall/syscall_linux.go
+0
-1
syscall_linux_386.go
src/pkg/syscall/syscall_linux_386.go
+3
-1
syscall_linux_amd64.go
src/pkg/syscall/syscall_linux_amd64.go
+1
-0
zsyscall_linux_386.go
src/pkg/syscall/zsyscall_linux_386.go
+7
-7
zsyscall_linux_amd64.go
src/pkg/syscall/zsyscall_linux_amd64.go
+7
-7
ztypes_linux_amd64.go
src/pkg/syscall/ztypes_linux_amd64.go
+2
-2
No files found.
src/pkg/syscall/syscall_linux.go
View file @
da5e962e
...
...
@@ -427,7 +427,6 @@ func SetsockoptLinger(fd, level, opt int, l *Linger) (errno int) {
//sys Rename(oldpath string, newpath string) (errno int)
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (errno int)
//sys Rmdir(path string) (errno int)
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, errno int)
//sys Setdomainname(p []byte) (errno int)
//sys Sethostname(p []byte) (errno int)
//sys Setpgid(pid int, pgid int) (errno int)
...
...
src/pkg/syscall/syscall_linux_386.go
View file @
da5e962e
...
...
@@ -58,6 +58,8 @@ func NsecToTimeval(nsec int64) (tv Timeval) {
//sys getgroups(n int, list *_Gid_t) (nn int, errno int) = SYS_GETGROUPS32
//sys setgroups(n int, list *_Gid_t) (errno int) = SYS_SETGROUPS32
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, errno int) = SYS__NEWSELECT
// Underlying system call writes to newoffset via pointer.
// Implemented in assembly to avoid allocation.
func
Seek
(
fd
int
,
offset
int64
,
whence
int
)
(
newoffset
int64
,
errno
int
)
...
...
@@ -93,7 +95,7 @@ const (
func
socketcall
(
call
int
,
a0
,
a1
,
a2
,
a3
,
a4
,
a5
uintptr
)
(
n
int
,
errno
int
)
func
accept
(
s
int
,
rsa
*
RawSockaddrAny
,
addrlen
*
_Socklen
)
(
fd
int
,
errno
int
)
{
fd
,
errno
=
socketcall
(
_
SOCKE
T
,
uintptr
(
s
),
uintptr
(
unsafe
.
Pointer
(
rsa
)),
uintptr
(
unsafe
.
Pointer
(
addrlen
)),
0
,
0
,
0
);
fd
,
errno
=
socketcall
(
_
ACCEP
T
,
uintptr
(
s
),
uintptr
(
unsafe
.
Pointer
(
rsa
)),
uintptr
(
unsafe
.
Pointer
(
addrlen
)),
0
,
0
,
0
);
return
;
}
...
...
src/pkg/syscall/syscall_linux_amd64.go
View file @
da5e962e
...
...
@@ -18,6 +18,7 @@ import "syscall"
//sys Listen(s int, n int) (errno int)
//sys Lstat(path string, stat *Stat_t) (errno int)
//sys Seek(fd int, offset int64, whence int) (off int64, errno int) = SYS_LSEEK
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, errno int)
//sys Setfsgid(gid int) (errno int)
//sys Setfsuid(uid int) (errno int)
//sys Setgid(gid int) (errno int)
...
...
src/pkg/syscall/zsyscall_linux_386.go
View file @
da5e962e
...
...
@@ -395,13 +395,6 @@ func Rmdir(path string) (errno int) {
return
;
}
func
Select
(
nfd
int
,
r
*
FdSet
,
w
*
FdSet
,
e
*
FdSet
,
timeout
*
Timeval
)
(
n
int
,
errno
int
)
{
r0
,
r1
,
e1
:=
Syscall6
(
SYS_SELECT
,
uintptr
(
nfd
),
uintptr
(
unsafe
.
Pointer
(
r
)),
uintptr
(
unsafe
.
Pointer
(
w
)),
uintptr
(
unsafe
.
Pointer
(
e
)),
uintptr
(
unsafe
.
Pointer
(
timeout
)),
0
);
n
=
int
(
r0
);
errno
=
int
(
e1
);
return
;
}
func
Setdomainname
(
p
[]
byte
)
(
errno
int
)
{
var
_p0
*
byte
;
if
len
(
p
)
>
0
{
_p0
=
&
p
[
0
];
}
...
...
@@ -707,5 +700,12 @@ func setgroups(n int, list *_Gid_t) (errno int) {
return
;
}
func
Select
(
nfd
int
,
r
*
FdSet
,
w
*
FdSet
,
e
*
FdSet
,
timeout
*
Timeval
)
(
n
int
,
errno
int
)
{
r0
,
r1
,
e1
:=
Syscall6
(
SYS__NEWSELECT
,
uintptr
(
nfd
),
uintptr
(
unsafe
.
Pointer
(
r
)),
uintptr
(
unsafe
.
Pointer
(
w
)),
uintptr
(
unsafe
.
Pointer
(
e
)),
uintptr
(
unsafe
.
Pointer
(
timeout
)),
0
);
n
=
int
(
r0
);
errno
=
int
(
e1
);
return
;
}
src/pkg/syscall/zsyscall_linux_amd64.go
View file @
da5e962e
...
...
@@ -395,13 +395,6 @@ func Rmdir(path string) (errno int) {
return
;
}
func
Select
(
nfd
int
,
r
*
FdSet
,
w
*
FdSet
,
e
*
FdSet
,
timeout
*
Timeval
)
(
n
int
,
errno
int
)
{
r0
,
r1
,
e1
:=
Syscall6
(
SYS_SELECT
,
uintptr
(
nfd
),
uintptr
(
unsafe
.
Pointer
(
r
)),
uintptr
(
unsafe
.
Pointer
(
w
)),
uintptr
(
unsafe
.
Pointer
(
e
)),
uintptr
(
unsafe
.
Pointer
(
timeout
)),
0
);
n
=
int
(
r0
);
errno
=
int
(
e1
);
return
;
}
func
Setdomainname
(
p
[]
byte
)
(
errno
int
)
{
var
_p0
*
byte
;
if
len
(
p
)
>
0
{
_p0
=
&
p
[
0
];
}
...
...
@@ -655,6 +648,13 @@ func Seek(fd int, offset int64, whence int) (off int64, errno int) {
return
;
}
func
Select
(
nfd
int
,
r
*
FdSet
,
w
*
FdSet
,
e
*
FdSet
,
timeout
*
Timeval
)
(
n
int
,
errno
int
)
{
r0
,
r1
,
e1
:=
Syscall6
(
SYS_SELECT
,
uintptr
(
nfd
),
uintptr
(
unsafe
.
Pointer
(
r
)),
uintptr
(
unsafe
.
Pointer
(
w
)),
uintptr
(
unsafe
.
Pointer
(
e
)),
uintptr
(
unsafe
.
Pointer
(
timeout
)),
0
);
n
=
int
(
r0
);
errno
=
int
(
e1
);
return
;
}
func
Setfsgid
(
gid
int
)
(
errno
int
)
{
r0
,
r1
,
e1
:=
Syscall
(
SYS_SETFSGID
,
uintptr
(
gid
),
0
,
0
);
errno
=
int
(
e1
);
...
...
src/pkg/syscall/ztypes_linux_amd64.go
View file @
da5e962e
...
...
@@ -253,7 +253,7 @@ type Linger struct {
}
type
FdSet
struct
{
__fds_b
its
[
16
]
int64
;
B
its
[
16
]
int64
;
}
type
Sysinfo_t
struct
{
...
...
@@ -281,7 +281,7 @@ type Utsname struct {
Release
[
65
]
int8
;
Version
[
65
]
int8
;
Machine
[
65
]
int8
;
__d
omainname
[
65
]
int8
;
D
omainname
[
65
]
int8
;
}
type
Ustat_t
struct
{
...
...
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