summaryrefslogtreecommitdiffstats
path: root/sbin/sysctl/sysctl.c
AgeCommit message (Collapse)AuthorFilesLines
2020-05-29dev/rndvar.h no longer has statistical interfaces (removed during variousderaadt1-2/+1
conversion steps). it only contains kernel prototypes for 4 interfaces, all of which legitimately belong in sys/systm.h, which are already included by all enqueue_randomness() users.
2019-12-25timeout(9): new flag: TIMEOUT_SCHEDULED, new statistic: tos_scheduledcheloha1-7/+7
This flag is set whenever a timeout is put on the wheel and cleared upon (a) running, (b) deletion, and (c) readdition. It serves two purposes: 1. Facilitate distinguishing scheduled and rescheduled timeouts. When a timeout is put on the wheel it is "scheduled" for a later softclock(). If this happens two or more times it is also said to be "rescheduled". The tos_rescheduled value thus indicates how many distant timeouts have been cascaded into a lower wheel level. 2. Eliminate false late timeouts. A timeout is not late if it is due before softclock() has had a chance to schedule it. To track this we need additional state, hence a new flag. rprocter@ raises some interesting questions. Some answers: - This interface is not stable and name changes are possible at a later date. - Although rescheduling timeouts is a side effect of the underlying implementation, I don't forsee us using anything but a timeout wheel in the future. Other data structures are too slow in practice, so I doubt that the concept of a rescheduled timeout will be irrelevant any time soon. - I think the development utility of gathering these sorts of statistics is high. Watching the distribution of timeouts under a given workflow is informative. ok visa@
2019-11-28ks_mapblocks is goneguenther1-3/+3
2019-10-29mobileip is going to the atticdlg1-3/+2
2019-09-22Let sysctl(1) work in single-user mode. Same diff applied by florian@krw1-3/+3
to ps(1). Noted by kettenis@. florian@'s fix pointed out by maestre@. ok maestre@
2019-07-12sysctl(2): add KERN_TIMEOUT_STATS: timeout(9) status and statistics.cheloha1-1/+22
With these totals one can track the throughput of the timeout(9) layer from userspace. With input from mpi@. ok mpi@
2019-07-03wire up net.link.ifrxq.pressure_return and pressure_dropdlg1-1/+48
ok visa@ deraadt@
2019-06-28When system calls indicate an error they return -1, not some arbitraryderaadt1-12/+12
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-06-16Restrict filesystem access to read only _PATH_DEVDB and /dev through unveil(2),mestre1-4/+15
discussed by many. Additionally call ctime(3) before unveil(2) in order to avoid potential $TZ expansion and therefore avoiding opening more files that would need to be read, idea from deraadt@. While here sort the headers alphabetically. OK florian@ deraadt@
2019-05-13KERN_PFSTATUS is not handled by sysctl so warn about it if requested butclaudio1-1/+6
ignore if sysctl -a is used. OK bluhm@
2019-02-21If sysctl(8) was compiled with an obsolete struct sensordev size,bluhm1-1/+5
it could get stuck in an endless loop. After sensors sysctl(2) fails, do not continue using uninitialized memory. Catch the error, print a warning, and skip the sensors. OK benno@ visa@ deraadt@
2019-01-29Add a dedicated sysctl(2) node for witness(4).visa1-1/+28
The new node contains the subsystem's main control variable, kern.witness.watch. It is aliased by the old name, kern.witnesswatch. The alias will be removed in the future. OK anton@ mpi@
2018-12-10Add a velocity sensor type (displayed as m/s)landry1-2/+5
Change distance sensor type to be displayed as meters with 3 decimals instead of millimeters. ok mpi@ kettenis@
2018-11-06vm.malloc_conf, userland sysctl parts; ok millert@ deraadt@otto1-2/+3
2018-09-29Use atomic operations to update vfc_refcount. Change the field's typevisa1-3/+3
to unsigned int. OK deraadt@
2018-09-22Revert previous. It broke /etc/rc.visa1-8/+65
Prompted by kn@
2018-09-21Stop displaying vfsconf reference counts so that the vfc_refcount fieldvisa1-65/+8
can be removed from struct mount. As a result of this diff, arrays vfsname[] and vfsvars[] are indexed by filesystem typenum. This makes the vfs_typenums[] array redundant. OK bluhm@ mpi@
2018-08-24display CPU_CPUID / machdep.cpuid in hex not decimaljsg1-1/+5
2018-07-16use ANSI C function declaration; no binary changejasper1-13/+3
2018-05-26In addition to "on" and "off", allow the audio "record.enable" mixerratchov1-1/+28
knob to take the new "sysctl" value, which is the default. In this case, the device behavior is determined by the new "kern.audio.record" sysctl(2), which defaults to zero. ok florian
2018-03-06Fix a small mistake from r1.229 causing sysctl(8) to print "newval -> newval"tim1-2/+2
instead of "oldval -> newval" when changing a string variable. OK florian@
2018-02-16simplify synopsis and text;jmc1-4/+2
ok millert
2018-02-10add support for binary sysctl payloads by handling them as hexflorian1-7/+99
strings. this was part of a demo showing how to implement the kernel side of sysctl(3) for setting Semantically Opaque Interface Identifier key material (for RFC 7217), but it seems to be the most straightforward path toward integrating soiikey handling and rc. Originally written by dlg, who commited it some time ago on my request. I then backed it out again, now it's time to put it back in. ok florian@ sthen@ naddy@ tb@ Man page bits tweaked & OK jmc
2017-07-19revert previous; the code this was supposed to be used for is movingflorian1-100/+7
in the wrong direction.
2017-07-17add support for binary sysctl payloads by handling them as hex strings.dlg1-7/+100
this was part of a demo showing how to implement the kernel side of sysctl(3) for setting Semantically Opaque Interface Identifier key material, but it seems to be the most straightforward path toward integrating soiikey handling and rc. ok florian@ sthen@ naddy@ tb@
2017-04-25Use strtonum instead of strto{,u}ll for simpler and better overflowtb1-11/+10
checking, make somaxconn and sominconn unsigned. Issue reported by orge on freenode, thanks! Input, patient explanations and ok deraadt, millert.
2017-03-16Fix a regression preventing ``kern.profiling'' to return the profilingmpi1-2/+3
state even with a correct kernel. Reported by jmc@, ok tb@
2016-12-22Remove PIM support from the multicast stack.rzalamena1-6/+3
ok mpi@
2016-10-18Rewrite the kern.malloc.kmemstat in the same style as previous. This one doesotto1-7/+4
not overflow because the initial count includes empty slots; ok tb@
2016-10-09fix heap overflow by rewriting loop; detected by new malloc canariesotto1-6/+3
ok krw@ beck@
2016-09-21sysctl KERN_ARND is no longer used (in ports, it only occurs in fallbackderaadt1-2/+1
paths of libevent). This interface was the first generation of what eventually became getentropy(2) and arc4random(3) -- june 1997! Ports scan by sthen, general agreement guenther
2016-09-02for reporting changes, hex and decimal were swappedderaadt1-3/+3
noticed by pirofti
2016-09-01Export machdep.cpufeature in hex, to avoid - values which madederaadt1-3/+14
yuo@ grumpy. ok tom guenther yuo
2016-08-27Pull in <sys/time.h> for struct timespecguenther1-1/+2
ok deraadt@
2016-08-14Use int64_t and %ll for CTLTYPE_QUAD nodes.guenther1-7/+8
Use memcpy() instead of up-casting from char* to long long* ok krw@
2016-07-27increase the size of forkstat fields to accomodate large valuestedu1-9/+9
2016-06-18Add net.inet.{tcp,udp}.rootonly sysctl, to mark which portsvgross1-3/+5
cannot be bound to by non-root users. Ok millert@ bluhm@
2016-05-23remove the sysctl kern.random counters, since none of the remainingderaadt1-35/+1
ones are capable of giving valuable works vs does-not-work evidence. ok tedu
2016-05-04Kill #ifdef INET6 occurrences in userland.jca1-9/+1
Prompted by and ok millert@ (tcpdump and libpcap left untouched, the #ifdef force is too strong with those)
2016-02-29delete the kern.emul/KERN_EMUL sysctl bits since there are nonaddy1-182/+1
emulations left; ok millert@ deraadt@, jmc@ (man pages)
2015-04-18Convert many atoi() calls to strtonum(), adding range checks and failurederaadt1-5/+28
handling along the way. Reviews by Brendan MacDonell, Jeremy Devenport, florian, doug, millert
2015-02-13Direct people to netstat for the new multicast routing sysctls.guenther1-1/+5
problem noted by dcoppa@ ok claudio@
2015-02-09provide a net.inet6.ip6.ifq sysctl so people can see and fiddledlg1-1/+15
with the ip6intrq. ok claudio@
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt1-2/+2
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-11-19delete the KERN_VNODE sysctl. it fails to provide any isolation from thetedu1-6/+1
kernel struct vnode defintion, and the only consumer (pstat) still needs kvm to read much of the required information. no great loss to always use kvm until there's a better replacement interface. ok deraadt millert uebayasi
2014-10-26Add a format specifier for the printf.brad1-2/+2
ok guenther@
2014-10-25Remove unnecessary netinet/in_systm.h include.lteo1-2/+1
ok millert@
2014-09-15Remove non-standard <sys/dkstat.h> header. It has not contained anythingmiod1-2/+2
related to disk stastics for almost 17 years, and the remaining userland-visible defines duplicate those found in <sys/sched.h>. Move the remaining _KERNEL defines to <sys/tty.h> where they belong, and update all users to cope with this. ok kettenis@
2014-08-16repair operation of kern.arandom, which will only allow a buffer ofderaadt1-2/+4
512 bytes. As a result, it stopped working... ok miod
2014-05-07missing word in error message. ok millerttedu1-3/+3