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
57d195e2
Commit
57d195e2
authored
Jun 13, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
os: Use Entersyscall when reading directories.
From-SVN: r188494
parent
f1dd0d9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
libgo/go/os/dir.go
+9
-2
No files found.
libgo/go/os/dir.go
View file @
57d195e2
...
...
@@ -42,7 +42,11 @@ func (file *File) readdirnames(n int) (names []string, err error) {
if
file
.
dirinfo
==
nil
{
file
.
dirinfo
=
new
(
dirInfo
)
file
.
dirinfo
.
buf
=
make
([]
byte
,
elen
)
file
.
dirinfo
.
dir
=
libc_opendir
(
syscall
.
StringBytePtr
(
file
.
name
))
p
:=
syscall
.
StringBytePtr
(
file
.
name
)
syscall
.
Entersyscall
()
r
:=
libc_opendir
(
p
)
syscall
.
Exitsyscall
()
file
.
dirinfo
.
dir
=
r
}
entry_dirent
:=
unsafe
.
Pointer
(
&
file
.
dirinfo
.
buf
[
0
])
.
(
*
syscall
.
Dirent
)
...
...
@@ -62,7 +66,10 @@ func (file *File) readdirnames(n int) (names []string, err error) {
for
n
!=
0
{
var
result
*
syscall
.
Dirent
i
:=
libc_readdir_r
(
dir
,
entry_dirent
,
&
result
)
pr
:=
&
result
syscall
.
Entersyscall
()
i
:=
libc_readdir_r
(
dir
,
entry_dirent
,
pr
)
syscall
.
Exitsyscall
()
if
i
!=
0
{
return
names
,
NewSyscallError
(
"readdir_r"
,
i
)
}
...
...
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