size_t confstr(int name, char *buf, size_t len);
The name argument represents the system variable to be queried. The implementation supports the name value of _CS_PATH , defined in <unistd.h>. It may support others.
If len is not 0, and if name has a configuration-defined value, confstr() copies that value into the len-byte buffer pointed to by buf. If the string to be returned is longer than len bytes, including the terminating null, then confstr() truncates the string to len-1 bytes and null-terminates the result. The application can detect that the string was truncated by comparing the value returned by confstr() with len.
If len is 0, and buf is a null pointer, then confstr() still returns the integer value as defined below, but does not return the string. If len is 0 but buf is not a null pointer, the result is unspecified.
If name is invalid, confstr() returns 0 and sets errno to indicate the error.
If name does not have a configuration-defined value, confstr() returns 0 and leaves errno unchanged.