]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
Rewrote RETURN VALUE discussion.
authorMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 1 May 2006 05:53:15 +0000 (05:53 +0000)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 1 May 2006 05:53:15 +0000 (05:53 +0000)
Updated CONFORMING TO.
Removed BUGS.

man3/confstr.3

index 5af591a8b40a8426b6c889309e518fbeacc5e12a..314a62d34bc1cc0b2cab15374ec1dae3717ad35b 100644 (file)
@@ -88,9 +88,35 @@ just returns the value as defined below.
 .SH "RETURN VALUE"
 If
 .I name
-does not correspond to a valid configuration variable,
+is a valid configuration variable,
 .BR confstr ()
+returns the number of bytes (including the terminating null byte) 
+that would be required to hold the entire value of that variable.
+This value may be greater than
+.IR len ,
+which means that the value in
+.I buf
+is truncated.
+
+If
+.I name 
+is a valid configuration variable, 
+but that variable does not have a value, then
+.I confstr ()
 returns 0.
+If
+.I name
+does not correspond to a valid configuration variable,
+.BR confstr ()
+returns 0, and
+.I errno
+is set to 
+.BR EINVAL .
+.SH ERRORS
+.BR EINVAL .
+If the value of
+.I name
+is invalid.
 .SH EXAMPLES
 The following code fragment determines the path where to find
 the POSIX.2 system utilities:
@@ -103,18 +129,8 @@ char *pathbuf; size_t n;
 n = confstr(_CS_PATH,NULL,(size_t)0);
 if ((pathbuf = malloc(n)) == NULL) abort();
 confstr(_CS_PATH, pathbuf, n);
-.SH ERRORS
-If the value of
-.I name
-is invalid,
-.I errno
-is set to
-.BR EINVAL .
 .SH "CONFORMING TO"
-proposed POSIX.2
-.SH BUGS
-POSIX.2 is not yet an approved standard; the information in this
-manpage is subject to change.
+POSIX.1-2001
 .SH "SEE ALSO"
 .BR sh (1),
 .BR exec (3),