summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2020-10-30 18:48:09 +0000
committerStefan Eßer <se@FreeBSD.org>2020-10-30 18:48:09 +0000
commit147eea393fdafa921e49bdb8cccfede3ba04547a (patch)
tree1cec88df2744ec8c9244223ae428272c3c739bee /lib
parente0f9cec7d6e1debaf5f164453fcb79a5835d97d9 (diff)
downloadsrc-test2-147eea393fdafa921e49bdb8cccfede3ba04547a.tar.gz
src-test2-147eea393fdafa921e49bdb8cccfede3ba04547a.zip
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/sysctl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/libc/gen/sysctl.c b/lib/libc/gen/sysctl.c
index 274e199dad5f..4495010332c8 100644
--- a/lib/libc/gen/sysctl.c
+++ b/lib/libc/gen/sysctl.c
@@ -87,6 +87,15 @@ sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp,
if (oldp != NULL)
memmove(oldp, _PATH_STDPATH, sizeof(_PATH_STDPATH));
return (0);
+ case USER_LOCALBASE:
+ if (oldp && orig_oldlen < sizeof(_PATH_LOCALBASE)) {
+ errno = ENOMEM;
+ return -1;
+ }
+ *oldlenp = sizeof(_PATH_LOCALBASE);
+ if (oldp != NULL)
+ memmove(oldp, _PATH_LOCALBASE, sizeof(_PATH_LOCALBASE));
+ return(0);
}
if (oldp && *oldlenp < sizeof(int)) {