]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add function getlocalbase() to libutil.
authorse <se@FreeBSD.org>
Wed, 18 Nov 2020 19:44:30 +0000 (19:44 +0000)
committerse <se@FreeBSD.org>
Wed, 18 Nov 2020 19:44:30 +0000 (19:44 +0000)
commitde04e86668f0bccf398e338a812e10c6ed43b453
tree1a3813aaa3be51504d2e5fba422cece04f79c9c8
parent59228046a4355b6ee265544e4d495f1787b8e5b9
Add function getlocalbase() to libutil.

This function returns the path to the local software base directory, by
default "/usr/local" (or the value of _PATH_LOCALBASE in include/paths.h
when building the world).

The value returned can be overridden by 2 methods:

- the LOCALBASE environment variable (ignored by SUID programs)
- else a non-default user.localbase sysctl value

Reviewed by: hps (earlier version)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D27236
lib/libutil/Makefile
lib/libutil/getlocalbase.3 [new file with mode: 0644]
lib/libutil/getlocalbase.c [new file with mode: 0644]
lib/libutil/libutil.h