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
e0be8a5c
Commit
e0be8a5c
authored
Mar 30, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall: Convert errno to error after Exitsyscall.
From-SVN: r186020
parent
a0d203b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
libgo/go/syscall/mksyscall.awk
+12
-1
No files found.
libgo/go/syscall/mksyscall.awk
View file @
e0be8a5c
...
@@ -199,6 +199,7 @@ BEGIN {
...
@@ -199,6 +199,7 @@ BEGIN {
}
}
printf
(
"c_%s(%s)\n"
,
cfnname
,
args
)
printf
(
"c_%s(%s)\n"
,
cfnname
,
args
)
seterr
=
0
if
(
gofnresults
!=
""
)
{
if
(
gofnresults
!=
""
)
{
fields
=
split
(
gofnresults
,
goresults
,
", *"
)
fields
=
split
(
gofnresults
,
goresults
,
", *"
)
if
(
fields
>
2
)
{
if
(
fields
>
2
)
{
...
@@ -218,13 +219,17 @@ BEGIN {
...
@@ -218,13 +219,17 @@ BEGIN {
gotype
=
goparam
[
2
]
gotype
=
goparam
[
2
]
if
(
goname
==
"err"
)
{
if
(
goname
==
"err"
)
{
print
"\tvar errno Errno"
print
"\tsetErrno := false"
if
(
cfnresult
~
/^
\*
/
)
{
if
(
cfnresult
~
/^
\*
/
)
{
print
"\tif _r == nil {"
print
"\tif _r == nil {"
}
else
{
}
else
{
print
"\tif _r < 0 {"
print
"\tif _r < 0 {"
}
}
print
"\t\terr = GetErrno()"
print
"\t\terrno = GetErrno()"
print
"\t\tsetErrno = true"
print
"\t}"
print
"\t}"
seterr
=
1
}
else
if
(
gotype
==
"uintptr"
&&
cfnresult
~
/^
\*
/
)
{
}
else
if
(
gotype
==
"uintptr"
&&
cfnresult
~
/^
\*
/
)
{
printf
(
"\t%s = (%s)(unsafe.Pointer(_r))\n"
,
goname
,
gotype
)
printf
(
"\t%s = (%s)(unsafe.Pointer(_r))\n"
,
goname
,
gotype
)
}
else
{
}
else
{
...
@@ -243,6 +248,12 @@ BEGIN {
...
@@ -243,6 +248,12 @@ BEGIN {
print
"\tExitsyscall()"
print
"\tExitsyscall()"
}
}
if
(
seterr
)
{
print
"\tif setErrno {"
print
"\t\terr = errno"
print
"\t}"
}
if
(
gofnresults
!=
""
)
{
if
(
gofnresults
!=
""
)
{
print
"\treturn"
print
"\treturn"
}
}
...
...
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