diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-13 04:47:25 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-13 04:47:25 +0000 |
commit | 3b74bd2d20a2677780de57b48a0e24208348e511 (patch) | |
tree | 46c11f99308277bb39550a919edf4549e01ee5af /libgo | |
parent | bdc109a03d963a473f9fe61a7b08c0abec60fa1f (diff) | |
download | gcc-3b74bd2d20a2677780de57b48a0e24208348e511.tar.gz |
os: Use Entersyscall when reading directories.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188494 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/go/os/dir.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libgo/go/os/dir.go b/libgo/go/os/dir.go index c693aebf377..02b21e6f7da 100644 --- a/libgo/go/os/dir.go +++ b/libgo/go/os/dir.go @@ -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) } |