4 static unsigned atou(char **s
)
7 for (x
=0; **s
-'0'<10U; ++*s
) x
=10*x
+(**s
-'0');
11 int __getpwent_a(FILE *f
, struct passwd
*pw
, char **line
, size_t *size
, struct passwd
**res
)
17 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE
, &cs
);
19 if ((l
=getline(line
, size
, f
)) < 0) {
20 rv
= ferror(f
) ? errno
: 0;
30 if (!(s
= strchr(s
, ':'))) continue;
32 *s
++ = 0; pw
->pw_passwd
= s
;
33 if (!(s
= strchr(s
, ':'))) continue;
35 *s
++ = 0; pw
->pw_uid
= atou(&s
);
36 if (*s
!= ':') continue;
38 *s
++ = 0; pw
->pw_gid
= atou(&s
);
39 if (*s
!= ':') continue;
41 *s
++ = 0; pw
->pw_gecos
= s
;
42 if (!(s
= strchr(s
, ':'))) continue;
44 *s
++ = 0; pw
->pw_dir
= s
;
45 if (!(s
= strchr(s
, ':'))) continue;
47 *s
++ = 0; pw
->pw_shell
= s
;
50 pthread_setcancelstate(cs
, 0);