diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-06-13 05:56:09 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-06-13 05:56:09 +0000 |
commit | 73b5b93a594570a013c1a082bed1e3da51785f76 (patch) | |
tree | b2742cf228cbeb8735de4f6a2a200b9a2a32e06e /libgo | |
parent | 57d195e2244c85b96baa4975de5a98aca45d53b6 (diff) | |
download | gcc-73b5b93a594570a013c1a082bed1e3da51785f76.zip gcc-73b5b93a594570a013c1a082bed1e3da51785f76.tar.gz gcc-73b5b93a594570a013c1a082bed1e3da51785f76.tar.bz2 |
os/user: Use Entersyscall.
From-SVN: r188496
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/go/os/user/lookup_unix.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libgo/go/os/user/lookup_unix.go b/libgo/go/os/user/lookup_unix.go index 68f8914..ebc86848 100644 --- a/libgo/go/os/user/lookup_unix.go +++ b/libgo/go/os/user/lookup_unix.go @@ -73,11 +73,14 @@ func lookup(uid int, username string, lookupByName bool) (*User, error) { const bufSize = 1024 buf := make([]byte, bufSize) if lookupByName { - rv := libc_getpwnam_r(syscall.StringBytePtr(username), + p := syscall.StringBytePtr(username) + syscall.Entersyscall() + rv := libc_getpwnam_r(p, &pwd, &buf[0], bufSize, &result) + syscall.Exitsyscall() if rv != 0 { return nil, fmt.Errorf("user: lookup username %s: %s", username, syscall.GetErrno()) } @@ -85,11 +88,13 @@ func lookup(uid int, username string, lookupByName bool) (*User, error) { return nil, UnknownUserError(username) } } else { + syscall.Entersyscall() rv := libc_getpwuid_r(syscall.Uid_t(uid), &pwd, &buf[0], bufSize, &result) + syscall.Exitsyscall() if rv != 0 { return nil, fmt.Errorf("user: lookup userid %d: %s", uid, syscall.GetErrno()) } |