/* getpwnamuid.c 4.7 85/02/04 */
static char line
[BUFSIZ
+1];
static struct passwd passwd
;
* The following are shared with getpwent.c
return ((struct passwd
*)NULL
);
key
= dbm_fetch(_pw_db
, key
);
return ((struct passwd
*)NULL
);
#define EXPAND(e) passwd.pw_/**/e = tp; while (*tp++ = *cp++);
bcopy(cp
, (char *)&passwd
.pw_uid
, sizeof (int));
bcopy(cp
, (char *)&passwd
.pw_gid
, sizeof (int));
bcopy(cp
, (char *)&passwd
.pw_quota
, sizeof (int));
register struct passwd
*pw
;
if (_pw_db
== (DBM
*)0 &&
(_pw_db
= dbm_open(_pw_file
, O_RDONLY
)) == (DBM
*)0) {
while ((pw
= getpwent()) && strcmp(nam
, pw
->pw_name
))
if (flock(dbm_dirfno(_pw_db
), LOCK_SH
) < 0) {
(void) flock(dbm_dirfno(_pw_db
), LOCK_UN
);
register struct passwd
*pw
;
if (_pw_db
== (DBM
*)0 &&
(_pw_db
= dbm_open(_pw_file
, O_RDONLY
)) == (DBM
*)0) {
while ((pw
= getpwent()) && pw
->pw_uid
!= uid
)
if (flock(dbm_dirfno(_pw_db
), LOCK_SH
) < 0) {
key
.dptr
= (char *) &uid
;
(void) flock(dbm_dirfno(_pw_db
), LOCK_UN
);