aboutsummaryrefslogtreecommitdiff
path: root/sbin/sysctl
Commit message (Collapse)AuthorAgeFilesLines
* s/Free Memory Pages/Free Memory/ to avoid confusion, since we'reEitan Adler2012-04-111-1/+1
| | | | | | | | | | | | reporting a number of bytes rather than a number of pages PR: misc/165208 Submitted by: Arnaud Lacombe <lacombar@gmail.com> Approved by: cperciva MFC after: 3 days Notes: svn path=/head/; revision=234134
* mdoc: terminate quoted strings.Joel Dahl2012-03-261-66/+66
| | | | | | | Reviewed by: brueffer Notes: svn path=/head/; revision=233510
* If the -d flag is specified, ignore any new values specified and onlyJohn Baldwin2011-12-011-1/+1
| | | | | | | | | | display the descriptions of specified nodes. Reported by: Jason Hellenthal jhell of dataix net MFC after: 2 weeks Notes: svn path=/head/; revision=228181
* Introduce signed and unsigned version of CTLTYPE_QUAD, renamingMatthew D Fleming2011-01-191-24/+42
| | | | | | | existing uses. Rename sysctl_handle_quad() to sysctl_handle_64(). Notes: svn path=/head/; revision=217616
* sysctl(8) should use the CTLTYPE to determine the type of data whenMatthew D Fleming2011-01-191-25/+29
| | | | | | | | | | | | | | reading. (This was already done for writing to a sysctl). This requires all SYSCTL setups to specify a type. Most of them are now checked at compile-time. Remove SYSCTL_*X* sysctl additions as the print being in hex should be controlled by the -x flag to sysctl(8). Succested by: bde Notes: svn path=/head/; revision=217586
* Fix typo and bump date.Matthew D Fleming2011-01-171-2/+2
| | | | Notes: svn path=/head/; revision=217522
* The kernel is not exporting any "T,dev_t" sysctl nodes anymore, soMatthew D Fleming2011-01-172-56/+2
| | | | | | | remove the capability and mention from sysctl(8). Notes: svn path=/head/; revision=217521
* Make the format of "Real Memory" and "Virtual Memory" lines moreMarko Zec2010-09-161-2/+2
| | | | | | | | | consistent with the rest of sysctl vm.vmtotal output. MFC after: 3 days Notes: svn path=/head/; revision=212726
* Free the memory allocated via strdup.Rebecca Cran2010-03-131-0/+1
| | | | | | | | | | PR: bin/113881 Submitted by: Alexander Drozdov dzal_mail mtu-net.ru Approved by: rrs (mentor) MFC after: 1 week Notes: svn path=/head/; revision=205118
* sysctl(8): make WARNS=3 cleanUlrich Spörlein2010-02-152-12/+18
| | | | | | | | | | Fixes inspired by work done in DragonflyBSD. PR: bin/140016 Approved by: ed (Co-mentor) Notes: svn path=/head/; revision=203917
* Add -i to usage()Gavin Atkinson2010-02-091-1/+1
| | | | | | | | Noticed by: ru MFC after: 5 days Notes: svn path=/head/; revision=203717
* Add the -i option to the synopsis.Gavin Atkinson2010-02-061-2/+2
| | | | | | | | Submitted by: dhw MFC after: 1 week (with r203310) Notes: svn path=/head/; revision=203547
* Implement the "-i" option to sysctl(8), to ignore failures whileGavin Atkinson2010-01-312-4/+15
| | | | | | | | | | | | | | retrieving individual OIDs. This allows the same list of OIDs to be passed to sysctl(8) across different systems where particular OIDs may not exist, and still get as much information as possible from them. PR: bin/123644 Submitted by: dhw Approved by: ed (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=203310
* Just use devname(3) to print device names.Ed Schouten2009-11-031-8/+1
| | | | | | | | | Right now sysctl just prints the major/minor numbers of a device. Instead of rolling our own routine for this, we'd better just call devname(3) to perform a translation to a device name for us. Notes: svn path=/head/; revision=198850
* Make input parsing in Farhenheit actually work.Ed Schouten2009-10-211-5/+5
| | | | | | | | | | | | | | | Don't clobber *p with '\0' when testing whether it has the value of 'F'. Just use the semantics of strtof() properly. If it returns p, we know that it parsed the string until it reached 'C' or 'F'. The code has not changed since it has been imported (r161951, Sep 3, 2006). Submitted by: Alexandre Perrin <kaworu@kaworu.ch> MFC after: 1 week Notes: svn path=/head/; revision=198340
* time_t does not always fit into long, for instance on arm. So rather castJohn Hay2009-06-231-3/+3
| | | | | | | it intmax_t and use %j in printf. Notes: svn path=/head/; revision=194684
* The sysctl(8) program exits on some errors and only emits warnings onMike Makonnen2008-06-231-2/+5
| | | | | | | | | | | | others. In the case where it displayed warnings it would still return succesfully. Modify it so that it returns the number of sysctls that it was not able to set. Make use of this in rc.d to display only *unsuccessfull* attempts to set sysctls. Notes: svn path=/head/; revision=179965
* Remove mentionings of kern.dumpdev which is no longer available.Remko Lodder2007-11-281-10/+1
| | | | | | | | | PR: docs/113570 Submitted by: lawrance MFC After: 3 days (where applicable) Notes: svn path=/head/; revision=174024
* Backout sensors framework.Alexander Leidinger2007-10-152-141/+0
| | | | | | | | Requested by: phk Discussed on: cvs-all Notes: svn path=/head/; revision=172674
* Import OpenBSD's sysctl hardware sensors framework.Alexander Leidinger2007-10-142-0/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit includes the following core components: * sample configuration file for sensorsd * rc(8) script and glue code for sensorsd(8) * sysctl(3) doc fixes for CTL_HW tree * sysctl(3) documentation for hardware sensors * sysctl(8) documentation for hardware sensors * support for the sensor structure for sysctl(8) * rc.conf(5) documentation for starting sensorsd(8) * sensor_attach(9) et al documentation * /sys/kern/kern_sensors.c o sensor_attach(9) API for drivers to register ksensors o sensor_task_register(9) API for the update task o sysctl(3) glue code o hw.sensors shadow tree for sysctl(8) internal magic * <sys/sensors.h> * HW_SENSORS definition for <sys/sysctl.h> * sensors display for systat(1), including documentation * sensorsd(8) and all applicable documentation The userland part of the framework is entirely source-code compatible with OpenBSD 4.1, 4.2 and -current as of today. All sensor readings can be viewed with `sysctl hw.sensors`, monitored in semi-realtime with `systat -sensors` and also logged with `sensorsd`. Submitted by: Constantine A. Murenin <cnst@FreeBSD.org> Sponsored by: Google Summer of Code 2007 (GSoC2007/cnst-sensors) Mentored by: syrinx Tested by: many OKed by: kensmith Obtained from: OpenBSD (parts) Notes: svn path=/head/; revision=172631
* document hw.realmemDaniel Gerzo2007-08-241-0/+1
| | | | | | | | | | Submitted by: cnst@ (Constantine A. Murenin) Sponsored by: Google Summer of Code 2007 Approved by: re@ (bmah) MFC after: 1 week Notes: svn path=/head/; revision=171955
* When we return from a "show" function without printing anything exceptBruce Evans2007-06-111-6/+6
| | | | | | | | | | | | | | | a warning, return 1 instead of 0 to indicate that we didn't print anything, so that top-level callers don't print a spurious newline. This is mainly to fix output formatting when stderr is redirected. It also helps in some cases when stderr is interleaved with stdout, depending on the details of the interleaving (this program has the usual null explicit support for syncing stderr with stdout). Return 1 instead of -1 after printing the "malloc failed" warning, since the return value is boolean. Notes: svn path=/head/; revision=170558
* Some improvements to the int-type printing code based on suggestions by bde.David Malone2007-06-101-17/+13
| | | | Notes: svn path=/head/; revision=170514
* Fix a number of WARNS, including printf, constness and unsigned comparisonDavid Malone2007-06-101-12/+13
| | | | | | | warnings. Notes: svn path=/head/; revision=170513
* Some style improvements suggested by bde, including removing anDavid Malone2007-06-101-37/+36
| | | | | | | | unused include, adding parens for return and sizeof and renaming, adding some missing whitespace and sorting some variables. Notes: svn path=/head/; revision=170512
* Use common code for printing ints and longs by coppying the sysctlDavid Malone2007-06-041-42/+42
| | | | | | | | | value into a variable of the right type and then printing it via an intmax_t. This makes avoids some duplication and makes it easy to add a new integer format Q for printing things of type CTLTYPE_QUAD. Notes: svn path=/head/; revision=170287
* Style: Shorten a couple of lines with u_int and u_long.Warner Losh2006-12-101-5/+3
| | | | Notes: svn path=/head/; revision=165070
* - Revert signedness type changes to "struct vmtotal"; by makingRuslan Ermilov2006-11-281-15/+11
| | | | | | | | | | | | | | | | | them unsigned I made the possible overflows hard to detect, and it only saved 1 bit which isn't principal, even less now that the underlying issue with the total of virtual memory has been fixed. (For the record, it will overflow with >=2T of VM total, with 32-bit ints used to keep counters in pages.) - While here, fix printing of other "struct vmtotal" members such as t_rq, t_dw, t_pw, and t_sw as they are also signed. Reviewed by: bde MFC after: 3 days Notes: svn path=/head/; revision=164718
* Fix the format specifier suitable for uintmax_t.Ruslan Ermilov2006-11-231-5/+5
| | | | Notes: svn path=/head/; revision=164557
* - Fix types of "struct vmmeter" members so they are unsigned.Ruslan Ermilov2006-11-201-12/+13
| | | | | | | | | | - Fix overflow bugs in sysctl(8), systat(1), and vmstat(8) when printing values of "struct vmmeter" in kilobytes as they don't necessarily fit into 32 bits. (Fix sysctl(8) reporting of a total virtual memory; it's in pages too.) Notes: svn path=/head/; revision=164443
* Remove a debugging statement from the previous commit.Hartmut Brandt2006-10-121-2/+0
| | | | Notes: svn path=/head/; revision=163277
* Don't free the buffer with the sysctl value before printing it.Hartmut Brandt2006-10-121-1/+4
| | | | Notes: svn path=/head/; revision=163275
* While convenient, avoid using alloca() for reasons specified inRuslan Ermilov2006-09-061-4/+20
| | | | | | | | | | | | the BUGS section of the alloca(3) manpage. In particular, when the number of TCP sockets is several tens of thousand, trying to "sysctl -a" would SIGSEGV on the net.inet.tcp.pcblist entry (it would exceed the stacksize ulimit, in an undetectable manner). Reported by: Igor Sysoev Notes: svn path=/head/; revision=162073
* Support Celsius (nn.nC), Fahrenheit (nn.nF) and Kelvin (nnnn) toHajimu UMEMOTO2006-09-031-4/+39
| | | | | | | | | | specify temperature. Reviewed by: njl MFC after: 3 days Notes: svn path=/head/; revision=161951
* Fix printing of integer Kelvins broken in rev. 1.71, which isRuslan Ermilov2006-08-151-3/+3
| | | | | | | | | fatal on sizeof(int) != sizeof(long) systems (such as amd64). MFC after: 1 day Notes: svn path=/head/; revision=161313
* Add an extension to the UINT & ULONG types. The XINT & XLONG types behaveDavid E. O'Brien2006-08-121-2/+10
| | | | | | | the same, except sysctl(8) will print out the values in hex. Notes: svn path=/head/; revision=161256
* Use floating point instead of hacking something together. Suggested byNate Lawson2006-08-041-10/+8
| | | | | | | | | bde@. Fix nearby int conversion and a couple style bugs. MFC after: 1 day Notes: svn path=/head/; revision=160963
* Fix printing of negative decimal values in Kelvin to Celsius conversion.Nate Lawson2006-07-251-2/+6
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=160658
* Add -q to usage().Ruslan Ermilov2005-12-011-2/+2
| | | | Notes: svn path=/head/; revision=152995
* -mdoc sweep.Ruslan Ermilov2005-11-181-2/+2
| | | | Notes: svn path=/head/; revision=152568
* Add "-q" argument to sysctl(8), which suppresses a limited set of warnings/Robert Watson2005-09-152-5/+17
| | | | | | | | | | errors generated. In particular, it suppresses "unknown oid" when attempting to get or set a sysctl not present in the kernel. MFC after: 1 week Notes: svn path=/head/; revision=150167
* - Remove MLINKS to nonexistant manpagesChristian Brueffer2005-07-141-1/+1
| | | | | | | | | | - Change some section numbers to match reality - For MLINKS to manpages from ports, mention which port installs them MFC after: 3 days Notes: svn path=/head/; revision=148011
* Show descriptions for type CTLTYPE_NODES.Matthew N. Dodd2005-04-131-0/+5
| | | | Notes: svn path=/head/; revision=144998
* Zero buffers. Seatbelt against sysctl(3) returning non-NUL terminatedMatthew N. Dodd2005-04-131-0/+2
| | | | | | | string data. Notes: svn path=/head/; revision=144997
* Sync program's usage() with manpage's SYNOPSIS.Ruslan Ermilov2005-02-101-1/+1
| | | | Notes: svn path=/head/; revision=141611
* Get rid of a NULL dereference when oid is too long.Suleiman Souhlal2005-01-251-1/+2
| | | | | | | | | Reviewed by: keramida Approved by: grehan (mentor) MFC after: 1 week Notes: svn path=/head/; revision=140818
* Sort sections.Ruslan Ermilov2005-01-181-26/+26
| | | | Notes: svn path=/head/; revision=140415
* Scheduled mdoc(7) sweep.Ruslan Ermilov2005-01-101-3/+2
| | | | Notes: svn path=/head/; revision=139987
* Code for automatic name completion in a tcsh(1) environment.Hiten Pandya2004-12-051-0/+7
| | | | | | | | PR: docs/44435 Submitted by: Slaven Rezic slaven dot rezic at berlin dot de Notes: svn path=/head/; revision=138421
* Use correct format string.Lukas Ertl2004-09-171-1/+1
| | | | | | | Submitted by: ssouhlal Notes: svn path=/head/; revision=135387