Clarify getpw*_r() return value when entry isn't found.
Improve markup of various constants.
This commit is contained in:
parent
9830ed3053
commit
f948a874e7
|
@ -1,4 +1,4 @@
|
||||||
.\" $NetBSD: getpwent.3,v 1.30 2005/04/04 18:26:19 wiz Exp $
|
.\" $NetBSD: getpwent.3,v 1.31 2005/04/19 04:26:16 lukem Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 1988, 1991, 1993
|
.\" Copyright (c) 1988, 1991, 1993
|
||||||
.\" The Regents of the University of California. All rights reserved.
|
.\" The Regents of the University of California. All rights reserved.
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
.\"
|
.\"
|
||||||
.\" @(#)getpwent.3 8.2 (Berkeley) 12/11/93
|
.\" @(#)getpwent.3 8.2 (Berkeley) 12/11/93
|
||||||
.\"
|
.\"
|
||||||
.Dd April 4, 2005
|
.Dd April 19, 2005
|
||||||
.Dt GETPWENT 3
|
.Dt GETPWENT 3
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
|
@ -134,7 +134,8 @@ act like their non re-entrant counterparts, updating the contents of
|
||||||
.Ar pw
|
.Ar pw
|
||||||
and storing a pointer to that in
|
and storing a pointer to that in
|
||||||
.Ar result ,
|
.Ar result ,
|
||||||
and returning 0.
|
and returning
|
||||||
|
.Dv 0 .
|
||||||
Storage used by
|
Storage used by
|
||||||
.Ar pw
|
.Ar pw
|
||||||
is allocated from
|
is allocated from
|
||||||
|
@ -142,10 +143,18 @@ is allocated from
|
||||||
which is
|
which is
|
||||||
.Ar buflen
|
.Ar buflen
|
||||||
bytes in size.
|
bytes in size.
|
||||||
If an error occurs,
|
If the requested entry cannot be found,
|
||||||
an error number will be returned and
|
|
||||||
.Ar result
|
.Ar result
|
||||||
will point to null.
|
will point to
|
||||||
|
.Dv NULL
|
||||||
|
and
|
||||||
|
.Dv 0
|
||||||
|
will be returned.
|
||||||
|
If an error occurs,
|
||||||
|
a non-zero error number will be returned and
|
||||||
|
.Ar result
|
||||||
|
will point to
|
||||||
|
.Dv NULL .
|
||||||
Calling
|
Calling
|
||||||
.Fn getpwent_r
|
.Fn getpwent_r
|
||||||
from multiple threads will result in each thread reading a disjoint portion
|
from multiple threads will result in each thread reading a disjoint portion
|
||||||
|
@ -199,7 +208,9 @@ The functions
|
||||||
and
|
and
|
||||||
.Fn getpwuid ,
|
.Fn getpwuid ,
|
||||||
return a valid pointer to a passwd structure on success
|
return a valid pointer to a passwd structure on success
|
||||||
and a null pointer if end-of-file is reached or an error occurs.
|
and a
|
||||||
|
.Dv NULL .
|
||||||
|
pointer if the entry was not found or an error occurs.
|
||||||
The
|
The
|
||||||
.Fn setpassent
|
.Fn setpassent
|
||||||
function returns 0 on failure and 1 on success.
|
function returns 0 on failure and 1 on success.
|
||||||
|
@ -216,7 +227,7 @@ and
|
||||||
.Fn getpwent_r
|
.Fn getpwent_r
|
||||||
return
|
return
|
||||||
.Dv 0
|
.Dv 0
|
||||||
on success and non-zero on failure.
|
on success or entry not found and non-zero on failure.
|
||||||
.Sh FILES
|
.Sh FILES
|
||||||
.Bl -tag -width /etc/master.passwd -compact
|
.Bl -tag -width /etc/master.passwd -compact
|
||||||
.It Pa /etc/pwd.db
|
.It Pa /etc/pwd.db
|
||||||
|
|
Loading…
Reference in New Issue