OSDN Git Service

(split) LDP: Update original to LDP v3.40.
[linuxjm/LDP_man-pages.git] / original / man3 / getpwnam.3
index 649da01..f9349da 100644 (file)
@@ -32,7 +32,7 @@
 .\" Modified 2003-11-15 by aeb
 .\" 2008-11-07, mtk, Added an example program for getpwnam_r().
 .\"
-.TH GETPWNAM 3  2010-10-21 "GNU" "Linux Programmer's Manual"
+.TH GETPWNAM 3  2012-04-23 "GNU" "Linux Programmer's Manual"
 .SH NAME
 getpwnam, getpwnam_r, getpwuid, getpwuid_r \- get password file entry
 .SH SYNOPSIS
@@ -126,12 +126,18 @@ A pointer to the result (in case of success) or NULL (in case no entry
 was found or an error occurred) is stored in
 .IR *result .
 .PP
-The maximum size needed for
-.I buf
-can be found using
-.BR sysconf (3)
-with the argument
-.BR _SC_GETPW_R_SIZE_MAX .
+The call
+
+    sysconf(_SC_GETPW_R_SIZE_MAX)
+
+returns either \-1, without changing
+.IR errno ,
+or an initial suggested size for
+.IR buf .
+(If this size is too small,
+the call fails with
+.BR ERANGE ,
+in which case the caller can retry with a larger buffer.)
 .SH "RETURN VALUE"
 The
 .BR getpwnam ()