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
58578905
Commit
58578905
authored
Dec 13, 2009
by
Christopher Wedgwood
Committed by
Russ Cox
Dec 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall: fix error return bug for 64-bit return on 32-bit platform
R=dho, rsc CC=r
https://golang.org/cl/176058
parent
977e19d6
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
29 deletions
+35
-29
mksyscall.sh
src/pkg/syscall/mksyscall.sh
+0
-1
zsyscall_darwin_386.go
src/pkg/syscall/zsyscall_darwin_386.go
+2
-1
zsyscall_freebsd_386.go
src/pkg/syscall/zsyscall_freebsd_386.go
+2
-1
zsyscall_linux_386.go
src/pkg/syscall/zsyscall_linux_386.go
+4
-2
zsyscall_linux_arm.go
src/pkg/syscall/zsyscall_linux_arm.go
+27
-24
No files found.
src/pkg/syscall/mksyscall.sh
View file @
58578905
...
...
@@ -158,7 +158,6 @@ while(<>) {
}
$ret
[
$i
]
=
sprintf
(
"r%d"
,
$i
)
;
$ret
[
$i
+1]
=
sprintf
(
"r%d"
,
$i
+1
)
;
$i
++
;
# loop will do another $i++
}
$body
.
=
"
\t
$name
=
$type
(
$reg
);
\n
"
;
}
...
...
src/pkg/syscall/zsyscall_darwin_386.go
View file @
58578905
...
...
@@ -502,8 +502,9 @@ func Rmdir(path string) (errno int) {
}
func
Seek
(
fd
int
,
offset
int64
,
whence
int
)
(
newoffset
int64
,
errno
int
)
{
r0
,
r1
,
_
:=
Syscall6
(
SYS_LSEEK
,
uintptr
(
fd
),
uintptr
(
offset
),
uintptr
(
offset
>>
32
),
uintptr
(
whence
),
0
,
0
);
r0
,
r1
,
e1
:=
Syscall6
(
SYS_LSEEK
,
uintptr
(
fd
),
uintptr
(
offset
),
uintptr
(
offset
>>
32
),
uintptr
(
whence
),
0
,
0
);
newoffset
=
int64
(
int64
(
r1
)
<<
32
|
int64
(
r0
));
errno
=
int
(
e1
);
return
;
}
...
...
src/pkg/syscall/zsyscall_freebsd_386.go
View file @
58578905
...
...
@@ -502,8 +502,9 @@ func Rmdir(path string) (errno int) {
}
func
Seek
(
fd
int
,
offset
int64
,
whence
int
)
(
newoffset
int64
,
errno
int
)
{
r0
,
r1
,
_
:=
Syscall6
(
SYS_LSEEK
,
uintptr
(
fd
),
uintptr
(
offset
),
uintptr
(
offset
>>
32
),
uintptr
(
whence
),
0
,
0
);
r0
,
r1
,
e1
:=
Syscall6
(
SYS_LSEEK
,
uintptr
(
fd
),
uintptr
(
offset
),
uintptr
(
offset
>>
32
),
uintptr
(
whence
),
0
,
0
);
newoffset
=
int64
(
int64
(
r1
)
<<
32
|
int64
(
r0
));
errno
=
int
(
e1
);
return
;
}
...
...
src/pkg/syscall/zsyscall_linux_386.go
View file @
58578905
...
...
@@ -453,8 +453,9 @@ func Setuid(uid int) (errno int) {
}
func
Splice
(
rfd
int
,
roff
*
int64
,
wfd
int
,
woff
*
int64
,
len
int
,
flags
int
)
(
n
int64
,
errno
int
)
{
r0
,
r1
,
_
:=
Syscall6
(
SYS_SPLICE
,
uintptr
(
rfd
),
uintptr
(
unsafe
.
Pointer
(
roff
)),
uintptr
(
wfd
),
uintptr
(
unsafe
.
Pointer
(
woff
)),
uintptr
(
len
),
uintptr
(
flags
));
r0
,
r1
,
e1
:=
Syscall6
(
SYS_SPLICE
,
uintptr
(
rfd
),
uintptr
(
unsafe
.
Pointer
(
roff
)),
uintptr
(
wfd
),
uintptr
(
unsafe
.
Pointer
(
woff
)),
uintptr
(
len
),
uintptr
(
flags
));
n
=
int64
(
int64
(
r1
)
<<
32
|
int64
(
r0
));
errno
=
int
(
e1
);
return
;
}
...
...
@@ -476,8 +477,9 @@ func Sysinfo(info *Sysinfo_t) (errno int) {
}
func
Tee
(
rfd
int
,
wfd
int
,
len
int
,
flags
int
)
(
n
int64
,
errno
int
)
{
r0
,
r1
,
_
:=
Syscall6
(
SYS_TEE
,
uintptr
(
rfd
),
uintptr
(
wfd
),
uintptr
(
len
),
uintptr
(
flags
),
0
,
0
);
r0
,
r1
,
e1
:=
Syscall6
(
SYS_TEE
,
uintptr
(
rfd
),
uintptr
(
wfd
),
uintptr
(
len
),
uintptr
(
flags
),
0
,
0
);
n
=
int64
(
int64
(
r1
)
<<
32
|
int64
(
r0
));
errno
=
int
(
e1
);
return
;
}
...
...
src/pkg/syscall/zsyscall_linux_arm.go
View file @
58578905
...
...
@@ -453,8 +453,9 @@ func Setuid(uid int) (errno int) {
}
func
Splice
(
rfd
int
,
roff
*
int64
,
wfd
int
,
woff
*
int64
,
len
int
,
flags
int
)
(
n
int64
,
errno
int
)
{
r0
,
r1
,
_
:=
Syscall6
(
SYS_SPLICE
,
uintptr
(
rfd
),
uintptr
(
unsafe
.
Pointer
(
roff
)),
uintptr
(
wfd
),
uintptr
(
unsafe
.
Pointer
(
woff
)),
uintptr
(
len
),
uintptr
(
flags
));
r0
,
r1
,
e1
:=
Syscall6
(
SYS_SPLICE
,
uintptr
(
rfd
),
uintptr
(
unsafe
.
Pointer
(
roff
)),
uintptr
(
wfd
),
uintptr
(
unsafe
.
Pointer
(
woff
)),
uintptr
(
len
),
uintptr
(
flags
));
n
=
int64
(
int64
(
r1
)
<<
32
|
int64
(
r0
));
errno
=
int
(
e1
);
return
;
}
...
...
@@ -476,8 +477,9 @@ func Sysinfo(info *Sysinfo_t) (errno int) {
}
func
Tee
(
rfd
int
,
wfd
int
,
len
int
,
flags
int
)
(
n
int64
,
errno
int
)
{
r0
,
r1
,
_
:=
Syscall6
(
SYS_TEE
,
uintptr
(
rfd
),
uintptr
(
wfd
),
uintptr
(
len
),
uintptr
(
flags
),
0
,
0
);
r0
,
r1
,
e1
:=
Syscall6
(
SYS_TEE
,
uintptr
(
rfd
),
uintptr
(
wfd
),
uintptr
(
len
),
uintptr
(
flags
),
0
,
0
);
n
=
int64
(
int64
(
r1
)
<<
32
|
int64
(
r0
));
errno
=
int
(
e1
);
return
;
}
...
...
@@ -637,6 +639,27 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
return
;
}
func
recvfrom
(
fd
int
,
p
[]
byte
,
flags
int
,
from
*
RawSockaddrAny
,
fromlen
*
_Socklen
)
(
n
int
,
errno
int
)
{
var
_p0
*
byte
;
if
len
(
p
)
>
0
{
_p0
=
&
p
[
0
]
}
r0
,
_
,
e1
:=
Syscall6
(
SYS_RECVFROM
,
uintptr
(
fd
),
uintptr
(
unsafe
.
Pointer
(
_p0
)),
uintptr
(
len
(
p
)),
uintptr
(
flags
),
uintptr
(
unsafe
.
Pointer
(
from
)),
uintptr
(
unsafe
.
Pointer
(
fromlen
)));
n
=
int
(
r0
);
errno
=
int
(
e1
);
return
;
}
func
sendto
(
s
int
,
buf
[]
byte
,
flags
int
,
to
uintptr
,
addrlen
_Socklen
)
(
errno
int
)
{
var
_p0
*
byte
;
if
len
(
buf
)
>
0
{
_p0
=
&
buf
[
0
]
}
_
,
_
,
e1
:=
Syscall6
(
SYS_SENDTO
,
uintptr
(
s
),
uintptr
(
unsafe
.
Pointer
(
_p0
)),
uintptr
(
len
(
buf
)),
uintptr
(
flags
),
uintptr
(
to
),
uintptr
(
addrlen
));
errno
=
int
(
e1
);
return
;
}
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
);
...
...
@@ -704,8 +727,9 @@ func Lstat(path string, stat *Stat_t) (errno int) {
}
func
Seek
(
fd
int
,
offset
int64
,
whence
int
)
(
off
int64
,
errno
int
)
{
r0
,
r1
,
_
:=
Syscall6
(
SYS_LSEEK
,
uintptr
(
fd
),
uintptr
(
offset
),
uintptr
(
offset
>>
32
),
uintptr
(
whence
),
0
,
0
);
r0
,
r1
,
e1
:=
Syscall6
(
SYS_LSEEK
,
uintptr
(
fd
),
uintptr
(
offset
),
uintptr
(
offset
>>
32
),
uintptr
(
whence
),
0
,
0
);
off
=
int64
(
int64
(
r1
)
<<
32
|
int64
(
r0
));
errno
=
int
(
e1
);
return
;
}
...
...
@@ -775,24 +799,3 @@ func Statfs(path string, buf *Statfs_t) (errno int) {
errno
=
int
(
e1
);
return
;
}
func
recvfrom
(
fd
int
,
p
[]
byte
,
flags
int
,
from
*
RawSockaddrAny
,
fromlen
*
_Socklen
)
(
n
int
,
errno
int
)
{
var
_p0
*
byte
;
if
len
(
p
)
>
0
{
_p0
=
&
p
[
0
]
}
r0
,
_
,
e1
:=
Syscall6
(
SYS_RECVFROM
,
uintptr
(
fd
),
uintptr
(
unsafe
.
Pointer
(
_p0
)),
uintptr
(
len
(
p
)),
uintptr
(
flags
),
uintptr
(
unsafe
.
Pointer
(
from
)),
uintptr
(
unsafe
.
Pointer
(
fromlen
)));
n
=
int
(
r0
);
errno
=
int
(
e1
);
return
;
}
func
sendto
(
s
int
,
buf
[]
byte
,
flags
int
,
to
uintptr
,
addrlen
_Socklen
)
(
errno
int
)
{
var
_p0
*
byte
;
if
len
(
buf
)
>
0
{
_p0
=
&
buf
[
0
]
}
_
,
_
,
e1
:=
Syscall6
(
SYS_SENDTO
,
uintptr
(
s
),
uintptr
(
unsafe
.
Pointer
(
_p0
)),
uintptr
(
len
(
buf
)),
uintptr
(
flags
),
uintptr
(
to
),
uintptr
(
addrlen
));
errno
=
int
(
e1
);
return
;
}
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