repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
add PTHREAD_NULL
[musl.git]
/
src
/
passwd
/
getspnam.c
blob
709b526dc503abb5ea8ab3cc5ec405196a6d7c1a
1
#include
"pwf.h"
2
3
#define LINE_LIM 256
4
5
struct
spwd
*
getspnam
(
const char
*
name
)
6
{
7
static struct
spwd sp
;
8
static char
*
line
;
9
struct
spwd
*
res
;
10
int
e
;
11
int
orig_errno
=
errno
;
12
13
if
(!
line
)
line
=
malloc
(
LINE_LIM
);
14
if
(!
line
)
return
0
;
15
e
=
getspnam_r
(
name
, &
sp
,
line
,
LINE_LIM
, &
res
);
16
errno
=
e
?
e
:
orig_errno
;
17
return
res
;
18
}