Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
24aea587
Commit
24aea587
authored
Mar 13, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libgo: Export {enter,exit}syscall and use it for getaddrinfo.
From-SVN: r185363
parent
13bd57a1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
13 deletions
+18
-13
libgo/go/net/cgo_unix.go
+6
-1
libgo/go/syscall/libcall_linux.go
+2
-2
libgo/go/syscall/libcall_support.go
+2
-2
libgo/go/syscall/mksyscall.awk
+2
-2
libgo/go/syscall/syscall_unix.go
+4
-4
libgo/runtime/runtime.h
+2
-2
No files found.
libgo/go/net/cgo_unix.go
View file @
24aea587
...
...
@@ -75,7 +75,10 @@ func cgoLookupPort(net, service string) (port int, err error, completed bool) {
}
s
:=
syscall
.
StringBytePtr
(
service
)
if
libc_getaddrinfo
(
nil
,
s
,
&
hints
,
&
res
)
==
0
{
syscall
.
Entersyscall
()
gerrno
:=
libc_getaddrinfo
(
nil
,
s
,
&
hints
,
&
res
)
syscall
.
Exitsyscall
()
if
gerrno
==
0
{
defer
libc_freeaddrinfo
(
res
)
for
r
:=
res
;
r
!=
nil
;
r
=
r
.
Ai_next
{
switch
r
.
Ai_family
{
...
...
@@ -108,7 +111,9 @@ func cgoLookupIPCNAME(name string) (addrs []IP, cname string, err error, complet
hints
.
Ai_flags
=
int32
((
syscall
.
AI_ALL
|
syscall
.
AI_V4MAPPED
|
syscall
.
AI_CANONNAME
)
&
cgoAddrInfoMask
())
h
:=
syscall
.
StringBytePtr
(
name
)
syscall
.
Entersyscall
()
gerrno
:=
libc_getaddrinfo
(
h
,
nil
,
&
hints
,
&
res
)
syscall
.
Exitsyscall
()
if
gerrno
!=
0
{
var
str
string
if
gerrno
==
syscall
.
EAI_NONAME
{
...
...
libgo/go/syscall/libcall_linux.go
View file @
24aea587
...
...
@@ -202,13 +202,13 @@ func Getdents(fd int, buf []byte) (n int, err error) {
}
else
{
p
=
(
*
byte
)(
unsafe
.
Pointer
(
&
_zero
))
}
e
ntersyscall
()
E
ntersyscall
()
r1
,
_
,
errno
:=
Syscall
(
SYS_GETDENTS64
,
uintptr
(
fd
),
uintptr
(
unsafe
.
Pointer
(
p
)),
uintptr
(
len
(
buf
)))
n
=
int
(
r1
)
if
n
<
0
{
err
=
errno
}
e
xitsyscall
()
E
xitsyscall
()
return
}
...
...
libgo/go/syscall/libcall_support.go
View file @
24aea587
...
...
@@ -6,7 +6,7 @@
package
syscall
func
e
ntersyscall
()
func
e
xitsyscall
()
func
E
ntersyscall
()
func
E
xitsyscall
()
func
GetErrno
()
Errno
func
SetErrno
(
Errno
)
libgo/go/syscall/mksyscall.awk
View file @
24aea587
...
...
@@ -190,7 +190,7 @@ BEGIN {
}
if
(
blocking
)
{
print
"\t
e
ntersyscall()"
print
"\t
E
ntersyscall()"
}
printf
(
"\t"
)
...
...
@@ -240,7 +240,7 @@ BEGIN {
}
if
(
blocking
)
{
print
"\t
e
xitsyscall()"
print
"\t
E
xitsyscall()"
}
if
(
gofnresults
!=
""
)
{
...
...
libgo/go/syscall/syscall_unix.go
View file @
24aea587
...
...
@@ -30,7 +30,7 @@ const darwinAMD64 = runtime.GOOS == "darwin" && runtime.GOARCH == "amd64"
// the arguments, so that we don't pass a 64-bit value when the function
// expects a 32-bit one.
func
Syscall
(
trap
,
a1
,
a2
,
a3
uintptr
)
(
r1
,
r2
uintptr
,
err
Errno
)
{
e
ntersyscall
()
E
ntersyscall
()
var
r
uintptr
if
unsafe
.
Sizeof
(
r
)
==
4
{
r1
:=
c_syscall32
(
int32
(
trap
),
int32
(
a1
),
int32
(
a2
),
int32
(
a3
),
0
,
0
,
0
)
...
...
@@ -40,12 +40,12 @@ func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {
r
=
uintptr
(
r1
)
}
err
=
GetErrno
()
e
xitsyscall
()
E
xitsyscall
()
return
r
,
0
,
err
}
func
Syscall6
(
trap
,
a1
,
a2
,
a3
,
a4
,
a5
,
a6
uintptr
)
(
r1
,
r2
uintptr
,
err
Errno
)
{
e
ntersyscall
()
E
ntersyscall
()
var
r
uintptr
if
unsafe
.
Sizeof
(
r
)
==
4
{
r1
:=
c_syscall32
(
int32
(
trap
),
int32
(
a1
),
int32
(
a2
),
int32
(
a3
),
...
...
@@ -57,7 +57,7 @@ func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
r
=
uintptr
(
r1
)
}
err
=
GetErrno
()
e
xitsyscall
()
E
xitsyscall
()
return
r
,
0
,
err
}
...
...
libgo/runtime/runtime.h
View file @
24aea587
...
...
@@ -298,8 +298,8 @@ void runtime_gosched(void);
void
runtime_tsleep
(
int64
);
M
*
runtime_newm
(
void
);
void
runtime_goexit
(
void
);
void
runtime_entersyscall
(
void
)
__asm__
(
"libgo_syscall.syscall.
e
ntersyscall"
);
void
runtime_exitsyscall
(
void
)
__asm__
(
"libgo_syscall.syscall.
e
xitsyscall"
);
void
runtime_entersyscall
(
void
)
__asm__
(
"libgo_syscall.syscall.
E
ntersyscall"
);
void
runtime_exitsyscall
(
void
)
__asm__
(
"libgo_syscall.syscall.
E
xitsyscall"
);
void
siginit
(
void
);
bool
__go_sigsend
(
int32
sig
);
int32
runtime_callers
(
int32
,
uintptr
*
,
int32
);
...
...
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