mirror of https://github.com/mkerrisk/man-pages
Rewrote RETURN VALUE discussion.
Updated CONFORMING TO. Removed BUGS.
This commit is contained in:
parent
8888a90efe
commit
4f43f21f30
|
@ -88,9 +88,35 @@ just returns the value as defined below.
|
||||||
.SH "RETURN VALUE"
|
.SH "RETURN VALUE"
|
||||||
If
|
If
|
||||||
.I name
|
.I name
|
||||||
|
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,
|
does not correspond to a valid configuration variable,
|
||||||
.BR confstr ()
|
.BR confstr ()
|
||||||
returns 0.
|
returns 0, and
|
||||||
|
.I errno
|
||||||
|
is set to
|
||||||
|
.BR EINVAL .
|
||||||
|
.SH ERRORS
|
||||||
|
.BR EINVAL .
|
||||||
|
If the value of
|
||||||
|
.I name
|
||||||
|
is invalid.
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
The following code fragment determines the path where to find
|
The following code fragment determines the path where to find
|
||||||
the POSIX.2 system utilities:
|
the POSIX.2 system utilities:
|
||||||
|
@ -103,18 +129,8 @@ char *pathbuf; size_t n;
|
||||||
n = confstr(_CS_PATH,NULL,(size_t)0);
|
n = confstr(_CS_PATH,NULL,(size_t)0);
|
||||||
if ((pathbuf = malloc(n)) == NULL) abort();
|
if ((pathbuf = malloc(n)) == NULL) abort();
|
||||||
confstr(_CS_PATH, pathbuf, n);
|
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"
|
.SH "CONFORMING TO"
|
||||||
proposed POSIX.2
|
POSIX.1-2001
|
||||||
.SH BUGS
|
|
||||||
POSIX.2 is not yet an approved standard; the information in this
|
|
||||||
manpage is subject to change.
|
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.BR sh (1),
|
.BR sh (1),
|
||||||
.BR exec (3),
|
.BR exec (3),
|
||||||
|
|
Loading…
Reference in New Issue