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
73b5b93a
Commit
73b5b93a
authored
Jun 13, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
os/user: Use Entersyscall.
From-SVN: r188496
parent
57d195e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
libgo/go/os/user/lookup_unix.go
+6
-1
No files found.
libgo/go/os/user/lookup_unix.go
View file @
73b5b93a
...
...
@@ -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
())
}
...
...
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