| Main index | Section 3 | Options |
#include <libutil.h>
The contents of the string returned by the getlocalbase() function shall not be modified.
The address returned by getlocalbase() will point into the executing processes environment if it is the result of getenv(LOCALBASE), to a static buffer if it is the result of sysctl(user.localbase), and to a constant string if the compiled in default value is returned.
The same value will be returned on successive calls during the run-time of the program, ignoring any changes to the environment variable or the sysctl value that might have been made.
The getlocalbase() function can be compiled with a non-default value of LOCALBASE_CTL_LEN. A value of 0 will disable fetching of the sysctl value, a value less than MAXPATHLEN will put a limit on the maximum string length supported for this sysctl value. If built with a non-default value of LOCALBASE_CTL_LEN, a value of the user.localbase sysctl variable longer than this value will make getlocalbase() return a valid string that is not a valid path prefix in any filesystem.
| GETLOCALBASE (3) | July 11, 2023 |
| Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
