aboutsummaryrefslogtreecommitdiff
path: root/sbin/sysctl/sysctl.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't err(3) (and exit prematurely) when a sysctl's object size hasAlfred Perlstein2002-05-241-9/+16
| | | | | | | changed, instead just warn(3) Notes: svn path=/head/; revision=97232
* Don't forget to null-terminate string we got from sysctl (f.e. in 'A' format).Andrey A. Chernov2002-05-081-1/+1
| | | | | | | Stack garbadge may be printed otherwise. Notes: svn path=/head/; revision=96234
* Take the "tickadj" element out of struct clockinfo. Our adjtime(2)Poul-Henning Kamp2002-04-151-2/+2
| | | | | | | | implementation is being changed and the very concept of tickadj will no longer be meaningful. Notes: svn path=/head/; revision=94752
* Make the handling of machdep.guessed_bootdev compiled on i386 only.Luigi Rizzo2002-03-111-1/+7
| | | | Notes: svn path=/head/; revision=92066
* Export a (machine dependent) kernel variable bootdev asLuigi Rizzo2002-03-101-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | machdep.guessed_bootdev, and add code to sysctl to parse its value and give a (not necessarily correct) name to the device we booted from (the main motivation for this code is to use the info in the PicoBSD boot scripts, and the impact on the kernel is minimal). NOTE: the information available in bootdev is not always reliable, so you should not trust it too much. The parsing code is the same as in boot2.c, and cannot cover all cases -- as it is, it seems to work fine with floppies and IDE disks recognised by the BIOS. It _should_ work as well with SCSI disks recognised by the BIOS. Booting from a CDROM in floppy emulation will return /dev/fd0 (because this is what the BIOS tells us). Booting off the network (e.g. with etherboot) leaves bootdev unset so the value will be printed as "invalid (0xffffffff)". Finally, this feature might go away at some point, hopefully when we have a more reliable way to get the same information. MFC-after: 5 days Notes: svn path=/head/; revision=92018
* #include <sys/time.h> instead of depending on namespace pollution inBruce Evans2002-02-251-3/+3
| | | | | | | | | | <sys/stat.h> for its prerequisite <sys/time.h>. #include <sys/param.h> in the correct place instead of bogusly including <sys/types.h>. Notes: svn path=/head/; revision=91217
* Allow setting of variables of type dev_t by indicating the name ofPoul-Henning Kamp2001-12-301-13/+34
| | | | | | | | | | | | | | | | | | a special file on the command line, eg: sysctl kern.dumpdev=/dev/ad1s1b In parse(), when a value is given for a CTLTYPE_QUAD variable, newval and newsize erroneously fail to be set because of an early "break". show_var() contains code that duplicates the functionality of the oidfmt() function. PR: 33151, 33150 Submitted by: Thomas Quinot <thomas@cuivre.fr.eu.org> Notes: svn path=/head/; revision=88696
* Add code to export and print the description associated to sysctlLuigi Rizzo2001-12-161-4/+16
| | | | | | | | | | | | | | | | | | | variables. Use the -d flag in sysctl(8) to see this information. Possible extensions to sysctl: + report variables that do not have a description + given a name, report the oid it maps to. Note to developers: have a look at your code, there are a number of variables which do not have a description. Note to developers: do we want this in 4.5 ? It is a very small change and very useful for documentation purposes. Suggested by: Orion Hodson Notes: svn path=/head/; revision=88006
* Implement -e option. It modifies the output produced by sysctl(8) inAnton Berezin2001-10-301-11/+19
| | | | | | | | | | | | | | such a way that the name and the value of the variable(s) are separated with `=' instead of the usual `: '. This is useful for producing output that can be fed back to the sysctl utility (pasted to sysctl.conf, for example). Reviewed by: rwatson Approved by: markm MFC after: 2 weeks Notes: svn path=/head/; revision=85747
* modfied sysctl command to allow setting values > 2GB if the mib supports it.Jim Pirzyk2001-06-181-1/+19
| | | | | | | | | PR: kern/21132 Reviewed by: no objections to by -arch MFC after: 1 month Notes: svn path=/head/; revision=78434
* Normalize the use of sizeof according to style(9).Dima Dorfman2001-06-091-19/+19
| | | | | | | Reviewed by: md5(1) Notes: svn path=/head/; revision=77928
* Remove unused variable (descr) in show_var().Dima Dorfman2001-06-011-1/+1
| | | | | | | | PR: 22582 Submitted by: Giorgos Keramidas <charon@gray.westgate.gr> Notes: svn path=/head/; revision=77567
* Perform random drive-by style cleanups, and rewrite a while loop thatDag-Erling Smørgrav2001-05-281-17/+18
| | | | | | | offended my artistic sensibilities. Notes: svn path=/head/; revision=77332
* Try to make sysctl options slightly more orthogonal:Dag-Erling Smørgrav2001-05-281-22/+25
| | | | | | | | | | | | | | | | | - introduce a -o option that displays opaque variables. - introduce a -x option that displays opaque variables in full. - deprecate -A in favor of -ao and -X in favor of -ax. - remove -A and -X from usage() and SYNOPSIS (but not from DESCRIPTION). - ignore -a if one or more variables were listed on the command line. - deprecate -w, it is not needed to determine the user's intentions. - some language and style cleanup in the man page. This commit should not break any existing scripts. MFC after: 4 weeks Notes: svn path=/head/; revision=77330
* Document the -N option in the usage message and the man page.Dag-Erling Smørgrav2001-01-141-5/+5
| | | | Notes: svn path=/head/; revision=71043
* Add a -N option that makes sysctl(8) print out just the variable names.Dag-Erling Smørgrav2001-01-141-10/+31
| | | | | | | | | | | | | | | | | Zsh users can add the following to their .zshrc for sysctl completion: function listsysctls { case $1 in *.*) set -A reply $(sysctl -AN ${1%.*}) ;; *) set -A reply $(sysctl -AN) ;; esac } compctl -K listsysctls sysctl While I'm here, brucify the getopt() switch. Notes: svn path=/head/; revision=71034
* Give correct results for SYSCTL_LONG arrays when sizeof(int) != sizeof(long)Andrew Gallatin2000-10-231-2/+2
| | | | | | | This fixes unaligned access on alpha for, eg, sysctl kern.ipc.mbtypes. Notes: svn path=/head/; revision=67476
* Array of long support.Poul-Henning Kamp2000-07-111-4/+10
| | | | | | | Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Notes: svn path=/head/; revision=62975
* Support for unsigned integer and long sysctl variables. Update theJohn Baldwin2000-07-051-2/+10
| | | | | | | | | | | | SYSCTL_LONG macro to be consistent with other integer sysctl variables and require an initial value instead of assuming 0. Update several sysctl variables to use the unsigned types. PR: 15251 Submitted by: Kelly Yancey <kbyanc@posi.net> Notes: svn path=/head/; revision=62622
* Handle minors like ls(1) does it.Poul-Henning Kamp2000-06-101-2/+8
| | | | | | | | PR: 19179 Submitted by: Kelly Yancey <kbyanc@posi.net> Notes: svn path=/head/; revision=61514
* Belatedly back out rev. 1.20.Dag-Erling Smørgrav1999-11-221-20/+7
| | | | Notes: svn path=/head/; revision=53561
* Allow octal or hex input.Greg Lehey1999-11-171-1/+1
| | | | | | | Suggested-by: Geoff Steckel <gwes@sitaranetworks.com> Notes: svn path=/head/; revision=53317
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* Avoid ambigious if/elseBill Fumerola1999-07-211-2/+3
| | | | Notes: svn path=/head/; revision=48956
* Clean up option handling a little.Dag-Erling Smørgrav1999-01-101-18/+34
| | | | | | | Add an option for showing sysctl descriptions instead of their values. Notes: svn path=/head/; revision=42456
* Allow for printing out integer arrays.Poul-Henning Kamp1998-11-081-2/+8
| | | | Notes: svn path=/head/; revision=41019
* Change length arguments to sysctl to size_t.Doug Rabson1998-08-251-5/+21
| | | | Notes: svn path=/head/; revision=38533
* Don't assume that time_t is long.Bruce Evans1998-06-291-2/+4
| | | | Notes: svn path=/head/; revision=37266
* Add missing argument detected by "-Wformat".John Polstra1997-11-181-2/+3
| | | | Notes: svn path=/head/; revision=31214
* Use err(3). Change err(-1,... to err(1,...Philippe Charnier1997-10-201-31/+29
| | | | Notes: svn path=/head/; revision=30602
* Display tickadj in struct clockinfo.John Hay1997-06-241-3/+3
| | | | Notes: svn path=/head/; revision=26899
* compare return value from getopt against -1 rather than EOF, per the finalWarner Losh1997-03-311-2/+2
| | | | | | | posix standard on the topic. Notes: svn path=/head/; revision=24428
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=22997
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Fix a core dump when the user gives "-w" without an "="Sujal Patel1996-04-101-1/+4
| | | | Notes: svn path=/head/; revision=15172
* The rewamped sysctl program that will find all the variables itself.Poul-Henning Kamp1995-12-211-433/+330
| | | | | | | Also a couple of handy new options. Notes: svn path=/head/; revision=12946
* Make sysctl compile again by removing all the debug stuff.Poul-Henning Kamp1995-11-171-32/+2
| | | | Notes: svn path=/head/; revision=12344
* Merge RELENG_2_0_5 into HEADRodney W. Grimes1995-06-111-2/+2
| | | | Notes: svn path=/head/; revision=9202
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-4/+4
| | | | Notes: svn path=/head/; revision=8857
* Learn how to print out kern.dumpdev as a name.Garrett Wollman1995-05-121-3/+12
| | | | Notes: svn path=/head/; revision=8479
* Allow the user access to net.inet.igmp, even though there's nothingGarrett Wollman1995-02-161-6/+11
| | | | | | | sysctl(8) can interpret there. (Someday there might be.) Notes: svn path=/head/; revision=6473
* Implement TCP MIB variables.Garrett Wollman1995-02-091-2/+9
| | | | Notes: svn path=/head/; revision=6284
* Suppress irritating extra newline after kern.boottime.Garrett Wollman1994-08-081-1/+1
| | | | Notes: svn path=/head/; revision=1951
* BSD 4.4 Lite usr.sbin SourcesRodney W. Grimes1994-05-261-0/+572
Notes: svn path=/cvs2svn/branches/WIN_TUE_NL/; revision=1553