confstr

Returns a system configuration string value.

Library:LibC
Classification:POSIX
Service:File and Directory I/O

Syntax

  #include <unistd.h> 
   
  size_t  confstr (
     int      name,
     char    *buf,
     size_t   len);
  

Parameters

name

(IN) Specifies a system configuration string. For a list of supported flags, see System Configuration Strings.

buf

(OUT) Points to the requested configuration string.

len

(IN) Specifies the size, in bytes, of the buffer for the string.

Return Values

If successful, returns the number of bytes required to hold the requested string, including the null-terminating character.If the buf parameter is too small for the string, the string is truncated and null terminated.

If no value is defined for name, returns 0 and does not set errno. If the name parameter is invalid, returns 0 and sets errno to the following:

Decimal

Constant

Description

9

EINVAL

The name parameter is invalid.

Remarks

To determine if the string has been truncated, compare the value in the len parameter with the returned value.

See Also