|
NAMEgetlocalbase —
return the path to the local software directory
LIBRARYSystem Utilities Library (libutil, -lutil)SYNOPSIS#include <libutil.h>
const char*
DESCRIPTIONThegetlocalbase () function returns the path to the
local software base directory. Normally this is the
/usr/local directory. First the
LOCALBASE environment variable is checked. If that
does not exist then the user.localbase sysctl is
checked. If that also does not exist then the value of the
_PATH_LOCALBASE compile-time variable is used. If that
is undefined then the default of /usr/local is used.
The contents of the string returned by the
IMPLEMENTATION NOTESCalls togetlocalbase () will perform a setugid check on
the running binary before checking the environment.
The address returned by 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 RETURN VALUESThegetlocalbase () function returns a pointer to a
string, whose length may exceed MAXPATHLEN, if it has been obtained from the
environment.
ENVIRONMENTThegetlocalbase () library function retrieves the
LOCALBASE environment variable.
ERRORSThegetlocalbase () function always succeeds and returns
a valid pointer to a string.
SEE ALSOenv(1), src.conf(5), sysctl(8)HISTORYThegetlocalbase library function first appeared in
FreeBSD 13.0.
AUTHORSThis manual page was written by Scott Long ⟨scottl@FreeBSD.org and Stefan Eßer <se@FreeBSD.org>⟩.
Visit the GSP FreeBSD Man Page Interface. |