Commit Graph

123 Commits

Author SHA1 Message Date
Ruslan Ermilov
e556ec911a Fix printing of integer Kelvins broken in rev. 1.71, which is
fatal on sizeof(int) != sizeof(long) systems (such as amd64).

MFC after:	1 day
2006-08-15 13:32:39 +00:00
David E. O'Brien
c157a036a9 Add an extension to the UINT & ULONG types. The XINT & XLONG types behave
the same, except sysctl(8) will print out the values in hex.
2006-08-12 23:33:10 +00:00
Nate Lawson
091eb5a3db Use floating point instead of hacking something together. Suggested by
bde@.  Fix nearby int conversion and a couple style bugs.

MFC after:	1 day
2006-08-04 07:31:55 +00:00
Nate Lawson
e05cdb7490 Fix printing of negative decimal values in Kelvin to Celsius conversion.
MFC after:	3 days
2006-07-25 02:28:43 +00:00
Ruslan Ermilov
855b068a9a Add -q to usage(). 2005-12-01 21:59:24 +00:00
Ruslan Ermilov
4e9e907d63 -mdoc sweep. 2005-11-18 10:36:29 +00:00
Robert Watson
f93d36fd92 Add "-q" argument to sysctl(8), which suppresses a limited set of warnings/
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
2005-09-15 16:08:04 +00:00
Christian Brueffer
f0ea72a038 - Remove MLINKS to nonexistant manpages
- Change some section numbers to match reality
- For MLINKS to manpages from ports, mention which port installs them

MFC after:	3 days
2005-07-14 20:29:08 +00:00
Matthew N. Dodd
b2680e2048 Show descriptions for type CTLTYPE_NODES. 2005-04-13 06:59:07 +00:00
Matthew N. Dodd
9f98e452c3 Zero buffers. Seatbelt against sysctl(3) returning non-NUL terminated
string data.
2005-04-13 06:56:31 +00:00
Ruslan Ermilov
8d646af581 Sync program's usage() with manpage's SYNOPSIS. 2005-02-10 09:19:34 +00:00
Suleiman Souhlal
1d4961c06f Get rid of a NULL dereference when oid is too long.
Reviewed by:	keramida
Approved by:	grehan (mentor)
MFC after:	1 week
2005-01-25 14:37:43 +00:00
Ruslan Ermilov
6087df9e8b Sort sections. 2005-01-18 10:09:38 +00:00
Ruslan Ermilov
214144704b Scheduled mdoc(7) sweep. 2005-01-10 16:17:34 +00:00
Hiten Pandya
ec3724d9d0 Code for automatic name completion in a tcsh(1) environment.
PR:		docs/44435
Submitted by:	Slaven Rezic slaven dot rezic at berlin dot de
2004-12-05 23:44:52 +00:00
Lukas Ertl
0a16dedc07 Use correct format string.
Submitted by:   ssouhlal
2004-09-17 17:08:44 +00:00
Peter Wemm
c591d41f7c Add a suffix descriptor for the acpi thermal values as a hint for the userland
sysctl tool to print a more readable value for temperatures.
2004-08-30 22:42:10 +00:00
Mark Murray
4c723140a4 Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp
2004-04-09 19:58:40 +00:00
Dima Dorfman
4d90830fd8 Add CTLTYPE_QUAD to the list of types for which we don't want an empty
value.  All the other numeric types are doing it . . .
2004-03-02 05:42:52 +00:00
Johan Karlsson
604d24db95 style.Makefile(5):
Use WARNS?= instead of WARNS=.
2004-02-23 20:25:27 +00:00
Dag-Erling Smørgrav
7434ec74a8 Alphabetization braino.
Pointed out by:	johan
2003-11-07 21:28:29 +00:00
Dag-Erling Smørgrav
705916c692 Whitespace cleanup. 2003-11-07 16:41:47 +00:00
Dag-Erling Smørgrav
45817aaa9c Add a command-line option to format output for human readability.
Currently, the only effect it has is to print some (but not all) numbers
using thousands separators.
2003-11-07 16:33:45 +00:00
Mike Silbersack
ac8711d28e Fix a few style glitches in the previous commit and make the
tunable error message more brief.

Suggested by:	bde
2003-11-01 07:06:04 +00:00
Peter Wemm
7e9c84c757 Fix a 64 bit warning. Have set_T_dev_t() take a pointer to a size_t rather
than a pointer to an int, since that is what it really wants anyway.
2003-10-26 04:45:08 +00:00
Mike Silbersack
d108e6633b Wrap a long line in the previous commit
Suggested by:	njl
2003-10-21 18:48:49 +00:00
Mike Silbersack
9b4b73b7ba Have sysctl print out a more useful error message when it detects that the
user has attempted to write to a read only, tunable value.
2003-10-21 16:49:30 +00:00
Ruslan Ermilov
fe08efe680 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
Robert Watson
a78d3eaffc Tighten up the string->integer conversion in sysctl(8):
(1) Reject zero-length strings for CTLTYPE_INT, _UINT, _LONG,
    _ULONG.  Do not silently convert to 0.

(2) When converting CTLTYPE_INT, _UINT, _LONG, and _ULONG, check the
    end pointer generated by strtol() and strtoul() rather than
    discarding it.  Reject the string if either none of the string
    was useful for conversion to an integer, or if there was
    trailing garbage.

I.e., we will not allow you to set a numeric sysctl to a value unless
we can completely convert the string argument to a numeric value.
I tripped over this when I put the following in /etc/sysctl.conf:

   kern.maxfiles="4000"

Ouch.
2003-06-15 06:26:08 +00:00
Philippe Charnier
4f898f942d .Nm -> .Xr 2003-06-08 12:57:39 +00:00
Christian Brueffer
ab5e6ef004 Clarify setting sysctl variables via loader(8) tunables
* s/can not/cannot/

Submitted by:	ru (*)
Approved by:	re (rwatson)
2003-05-18 00:27:02 +00:00
Christian Brueffer
433087977a Add information about setting sysctl variables via loader(8) and
loader.conf(5)

PR:		38426 (slightly modified)
Submitted by:	Phil Pennock <pdp@nl.demon.net>
Approved by:	re (bmah)
MFC after:	3 days
2003-05-17 01:01:03 +00:00
Tim J. Robbins
7a22a933fa This file does not seem to serve any purpose. It has never been hooked up
to the build, and performs a subset of the functionality that the getconf(1)
utility performs.
2003-04-28 00:38:48 +00:00
Poul-Henning Kamp
5b03e4b6a1 Output machdep.guessed_bootdev as an integer rather than try to format
it according to ancient and obsolete rules.

This removes one more user of <sys/diskslice.h>
2003-04-03 21:41:14 +00:00
Peter Wemm
661b2c1683 Fix what I think is an off-by-one in certain worst-case scenarios
caused by rev 1.45.  (eg: the estimate being exactly half of the result.)
2003-01-22 00:34:22 +00:00
Matthew Dillon
654e22e7bb Cleanup the formatting from the last commit, convert everything to
a more human-readable 'kilobytes' instead of pages.
2003-01-11 20:03:43 +00:00
Matthew Dillon
f7550ecf3f Make 'sysctl vm.vmtotal' work properly using updated patch from Hiten.
(the patch in the PR was stale).

PR:             kern/5689
Submitted by:   Hiten Pandya <hiten@unixdaemons.com>
2003-01-11 07:29:47 +00:00
Peter Wemm
9866352ec7 Fix a "bug" in sysctl(8). Limit the length when we print a string from
the kernel rather than ignoring the length and keeping on going till we
finally hit a \0 character in the buffer.
2002-11-12 21:18:21 +00:00
Philippe Charnier
7fed38d0a0 Replace various spelling with FALLTHROUGH which is lint()able 2002-08-25 13:10:45 +00:00
Philippe Charnier
629e80effb The .Nm utility. 2002-07-06 19:35:14 +00:00
Alfred Perlstein
996076bbc7 Don't err(3) (and exit prematurely) when a sysctl's object size has
changed, instead just warn(3)
2002-05-24 08:34:18 +00:00
Andrey A. Chernov
76d3dc5297 Don't forget to null-terminate string we got from sysctl (f.e. in 'A' format).
Stack garbadge may be printed otherwise.
2002-05-08 23:49:19 +00:00
Poul-Henning Kamp
b35c8f287d Take the "tickadj" element out of struct clockinfo. Our adjtime(2)
implementation is being changed and the very concept of tickadj will
no longer be meaningful.
2002-04-15 12:11:06 +00:00
Warner Losh
d476a036e2 o remove __P
o remove main prototype
2002-03-21 13:20:49 +00:00
Ruslan Ermilov
d1f8bca053 mdoc(7) police: tiny fixes. 2002-03-15 15:07:39 +00:00
Luigi Rizzo
617cc038bc Document the existence of machdep.guessed_bootdev, as suggested
by Sheldon.
For a detailed description look at the commit log for sysctl.c
rev.1.42 -- i do not think it is appropriate to put the full
description in this manpage, and the "boot" and "loader" manpages
where this description might go are also missing a description of
a number of similar variables, so i think this it is ok to limit
documentation to this now, and update it later when I (or someone
else) have a chance to revise "boot" and "loader".
2002-03-12 13:55:19 +00:00
Luigi Rizzo
bca9bbeae7 Make the handling of machdep.guessed_bootdev compiled on i386 only. 2002-03-11 06:50:28 +00:00
Luigi Rizzo
60cf2c1254 Export a (machine dependent) kernel variable bootdev as
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
2002-03-10 20:08:44 +00:00
Dima Dorfman
42277d473c Document `sysctl variable=/dev/foo' syntax.
PR:		34184
Submitted by:	Thomas Quinot <thomas@cuivre.fr.eu.org>
2002-03-10 09:53:39 +00:00
Bruce Evans
ce68584226 #include <sys/time.h> instead of depending on namespace pollution in
<sys/stat.h> for its prerequisite <sys/time.h>.

#include <sys/param.h> in the correct place instead of bogusly including
<sys/types.h>.
2002-02-25 03:36:06 +00:00