aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/gen/sysctl.c
Commit message (Collapse)AuthorAgeFilesLines
* Re-arrange some of the code to separate writable user tree variables fromStefan Eßer2020-11-021-28/+27
| | | | | | | | | | | R/O variables. While here fix some nearby style. No functional change intended. MFC after: 1 month Notes: svn path=/head/; revision=367280
* Make sysctl user.local a tunable that can be written at run-timeStefan Eßer2020-10-311-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | This sysctl value had been provided as a read-only variable that is compiled into the C library based on the value of _PATH_LOCALBASE in paths.h. After this change, the value is compiled into the kernel as an empty string, which is translated to _PATH_LOCALBASE by the C library. This empty string can be overridden at boot time or by a privileged user at run time and will then be returned by sysctl. When set to an empty string, the value returned by sysctl reverts to _PATH_LOCALBASE. This update does not change the behavior on any system that does not modify the default value of user.localbase. I consider this change as experimental and would prefer if the run-time write permission was reconsidered and the sysctl variable defined with CLFLAG_RDTUN instead to restrict it to be set at boot time. MFC after: 1 month Notes: svn path=/head/; revision=367243
* Fix reversed condition after attempted style fix in r367196Stefan Eßer2020-10-311-2/+2
| | | | | | | | Reported by: xtouqh@hotmail.com MFC after: 3 days Notes: svn path=/head/; revision=367199
* Fix style, no functional changeStefan Eßer2020-10-311-5/+5
| | | | | | | | Submitted by: kib MFC after: 3 days Notes: svn path=/head/; revision=367196
* Add read only sysctl variable user.localbaseStefan Eßer2020-10-301-0/+9
| | | | | | | | | | | | The value is provided by the C library as for other sysctl variables in the user tree. It is compiled in and returns the value of _PATH_LOCALBASE defined in paths.h. Reviewed by: imp, scottl Differential Revision: https://reviews.freebsd.org/D27009 Notes: svn path=/head/; revision=367179
* Clean up the vcs ID strings in libc's gen/ directory.John Baldwin2018-07-031-3/+1
| | | | | | | | | | | | | | | | | | | | - Move CSRG IDs into __SCCSID(). - When a file has been copied, consistently use 'From: <tag>' for strings referencing the version of the source file copied from in the license block comment. - Some of the 'From:' tags were using $FreeBSD$ that was being expanded on each checkout. Fix those to hardcode the FreeBSD tag from the file that was copied at the time of the copy. - When multiple strings are present list them in "chronological" order, so CSRG (__SCCSID) before FreeBSD (__FBSDID). If a file came from OtherBSD and contains a CSRG ID from the OtherBSD file, use the order CSRG -> OtherBSD -> FreeBSD. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D15831 Notes: svn path=/head/; revision=335898
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Fix sysctl(3) so it returns the intended values for all mib names inPatrick Kelsey2015-07-061-2/+14
| | | | | | | | | | | | | the 'user' sysctl tree, which have all been coming back 0 or empty since r240176. Differential Revision: https://reviews.freebsd.org/D2945 Reviewed by: sbruno Approved by: jmallett (mentor) MFC after: 3 days Notes: svn path=/head/; revision=285188
* Avoid segfault if name is invalid. Basically, onlyTom Rhodes2012-09-061-2/+5
| | | | | | | | | | check for CTL_USER if the sysctl fails with ENOENT. PR: 169056 Reviewed by: jhb Notes: svn path=/head/; revision=240176
* Add proper const keywords to sysctl(3) parameters.Ed Schouten2010-02-211-7/+4
| | | | | | | | | | | | | | | | The `name' and `newp' arguments can be marked const, because the buffers they refer to are never changed. While there, perform some other cleanups: - Remove K&R from sysctl.c. - Implement sysctlbyname() using sysctlnametomib() to prevent duplication of an undocumented kernel interface. - Fix some whitespace nits. It seems the prototypes are now in sync with NetBSD as well. Notes: svn path=/head/; revision=204170
* Per Regents of the University of Calfornia letter, remove advertisingWarner Losh2007-01-091-4/+0
| | | | | | | | | clause. # If I've done so improperly on a file, please let me know. Notes: svn path=/head/; revision=165903
* Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go).Jacques Vidrine2003-02-161-0/+3
| | | | | | | | | | Only warnings that could be fixed without changing the generated object code and without restructuring the source code have been handled. Reviewed by: /sbin/md5 Notes: svn path=/head/; revision=111010
* Fix the style of the SCM ID's.David E. O'Brien2002-03-221-0/+2
| | | | | | | I believe have made all of libc .c's as consistent as possible. Notes: svn path=/head/; revision=92986
* Make the implementation and documentation agree. Specifically:Dag-Erling Smørgrav1999-01-061-4/+8
| | | | | | | | | | - document that sysctl() and sysctlbyname() return 0 on success - if the provided buffer is too small, set errno to ENOMEM and return -1 instead of returning ENOMEM. Notes: svn path=/head/; revision=42353
* Minor cleanup, mostly unused vars and missing #includes.Poul-Henning Kamp1995-10-221-0/+1
| | | | Notes: svn path=/head/; revision=11659
* BSD 4.4 Lite Lib SourcesRodney W. Grimes1994-05-271-0/+177
Notes: svn path=/cvs2svn/branches/unlabeled-1.1.1/; revision=1573