macro and text revision (-mdoc version 3)
[unix-history] / usr / src / lib / libcompat / 4.1 / getpw.3
index 5c2402d..b85f25b 100644 (file)
@@ -1,36 +1,52 @@
-.\"    @(#)getpw.3     6.3 (Berkeley) %G%
+.\" Copyright (c) 1990 The Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.TH GETPW 3  ""
-.AT 3
-.SH NAME
-getpw \- get name from uid
-.SH SYNOPSIS
-.nf
-.B getpw(uid, buf)
-.B char *buf;
-.fi
-.SH DESCRIPTION
-.ft B
-Getpw is made obsolete by getpwuid(3).
+.\" %sccs.include.redist.man%
+.\"
+.\"     @(#)getpw.3    6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt GETPW 3
+.Os
+.Sh NAME
+.Nm getpw
+.Nd get name from uid
+.Sh SYNOPSIS
+.Fn getpw uid "char *buf"
+.Sh DESCRIPTION
+.Bf -symbolic
+The getpw function is made obsolete by getpwuid(3).
 .br
 It is available from the compatibility library, libcompat.
 .br
 It is available from the compatibility library, libcompat.
-.ft R
-.PP
-.I Getpw
-searches the password file for
-the (numerical)
-.IR uid ", and fills in " "buf"
-with the corresponding line;
-it returns non-zero if
-.IR uid ""
-could not
-be found.
-The line is null-terminated.
-.SH FILES
-/etc/passwd
-.SH "SEE ALSO"
-getpwent(3),
-passwd(5)
-.SH DIAGNOSTICS
-Non-zero
-return on error.
+.Ef
+.Pp
+The
+.Fn getpw
+function reads the file
+.Pa /etc/passwd ,
+and if it finds
+the specified
+.Fa uid ,
+copies the password entry line into the string pointed to by
+.Fa buf .
+the null terminated entry line from the password database,
+and appends the
+.Dv NUL
+character.
+.Sh RETURN VALUES
+The
+.Fn getpw
+function returns the zero if successful, otherwise 
+a non-zero if the entry does not exist.
+.Sh FILES
+.Bl -tag -width /etc/passwd - compact
+.It Pa /etc/passwd
+.El
+.Sh SEE ALSO
+.Xr getpwent 3 ,
+.Xr passwd 5
+.Sh HISTORY
+A
+.Fn getpw
+function appeared in
+.At v6 .