4.4BSD/usr/share/man/cat3/confstr.0
CONFSTR(3) BSD Programmer's Manual CONFSTR(3)
NNAAMMEE
ccoonnffssttrr - get string-valued configurable variables
SSYYNNOOPPSSIISS
##iinncclluuddee <<uunniissttdd..hh>>
_s_i_z_e___t
ccoonnffssttrr(_i_n_t _n_a_m_e, _c_h_a_r _*_b_u_f, _s_i_z_e___t _l_e_n);
DDEESSCCRRIIPPTTIIOONN
TThhiiss iinntteerrffaaccee iiss oobbssoolleetteedd bbyy ssyyssccttll((33))..
The ccoonnffssttrr() function provides a method for applications to get configu-
ration defined string values.
The _n_a_m_e argument specifies the system variable to be queried. Symbolic
constants for each name value are found in the include file <unistd.h>.
The _l_e_n argument specifies the size of the buffer referenced by the argu-
ment _b_u_f. If _l_e_n is non-zero, _b_u_f is a non-null pointer, and _n_a_m_e has a
value, up to _l_e_n - 1 bytes of the value are copied into the buffer _b_u_f.
The copied value is always null terminated.
The available values are as follows:
_CS_PATH
Return a value for the PATH environment variable that finds all
the standard utilities.
RREETTUURRNN VVAALLUUEESS
If the call to ccoonnffssttrr is not successful, -1 is returned and _e_r_r_n_o is set
appropriately. Otherwise, if the variable does not have a configuration
defined value, 0 is returned and _e_r_r_n_o is not modified. Otherwise, the
buffer size needed to hold the entire configuration-defined value is re-
turned. If this size is greater than the argument _l_e_n, the string in _b_u_f
was truncated.
EERRRROORRSS
The ccoonnffssttrr function may fail and set _e_r_r_o_r for any of the errors speci-
fied for the library functions malloc(3) and sysctl(3).
In addition, the following errors may be reported:
[EINVAL] The value of the _n_a_m_e argument is invalid.
SSEEEE AALLSSOO
sysctl(3)
HHIISSTTOORRYY
The ccoonnffssttrr function first appeared in 4.4BSD.
4th Berkeley Distribution June 4, 1993 1