HP-UX Reference (11i v2 07/12) - 3 Library Functions A-M (vol 6)

c
confstr(3C) confstr(3C)
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), thread_safety(5).
STANDARDS CONFORMANCE
confstr(): XPG4, POSIX.2
HP-UX 11i Version 2: December 2007 Update 3 Hewlett-Packard Company 205