2 .\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 .\" Copyright 2020 Scott Long
5 .\" Copyright 2020 Stefan Eßer
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .Nd "return the path to the local software directory"
41 .Fn getlocalbase "void"
45 function returns the path to the local software base directory.
51 environment variable is checked.
52 If that does not exist then the
55 If that also does not exist then the value of the
57 compile-time variable is used.
58 If that is undefined then the default of
62 The value returned by the
64 function shall not be modified.
65 .Sh IMPLEMENTATION NOTES
68 will perform a setugid check on the running binary before checking the
73 function always succeeds and returns a pointer to a string, whose length
74 may exceed MAXPATHLEN if it has been derived from the environment variable
76 No length checks are performed on the result.
80 library function retrieves the
86 function always succeeds.
94 library function first appeared in
98 manual page was written by
99 .An Scott Long Aq Mt scottl@FreeBSD.org and Stefan Eßer Aq Mt se@FreeBSD.org .