HP-UX Reference (11i v1 00/12) - 3 Library Functions A-M (vol 6)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/!!!intro.3c
________________________________________________________________
___ ___
c
confstr(3C) confstr(3C)
Application Usage
confstr() is thread-safe. A cancellation point may occur when a thread is executing confstr().
RETURN VALUE
If name is invalid, confstr() returns zero and sets errno to EINVAL.
If name does not have a configuration-defined value, confstr() returns 0 (zero) and leaves errno
unchanged.
If name has a configuration-defined value, confstr() returns the size of buffer that would be needed to
hold the entire configuration-defined value. If this return value is less than len, the string returned in buf
has been truncated.
EXAMPLES
The following code fragment calls confstr() to determine the correct buffer size for _CS_PATH, allo-
cates space for this buffer, then gets the configuration value for _CS_PATH.
#include <unistd.h>
#include <stddef.h>
size_t bufsize;
char *buffer;
bufsize=confstr(_CS_PATH,NULL,(size_t)0);
buffer=(char *)malloc(bufsize);
confstr(_CS_PATH,buffer,bufsize);
AUTHOR
confstr() was developed by HP.
FILES
/usr/include/unistd.h
SEE ALSO
getconf(1), errno(2), fpathconf(2), pathconf(2), sysconf(2), malloc(3C).
STANDARDS CONFORMANCE
confstr(): XPG4, POSIX.2
HP-UX Release 11i: December 2000 − 3 − Section 3−−79
___
___