Commit Graph

48 Commits

Author SHA1 Message Date
simonb 7eb2ec40b2 Remove the KERN_DRIVERS case handler (prototype code?). 2003-06-17 03:34:23 +00:00
dsl f8f6959024 Print hw.cnmagic as escaped hex bytes (unless -n given).
Change 'special' to be a numeral not a bit, it isn't ever used as a bit
and I can't see why it should ever be used that way.
2003-06-16 21:52:58 +00:00
thorpej 56962fed64 Avoid a strict-alias warning in gcc 3.3. 2003-05-31 23:42:23 +00:00
itojun 8138cbd1bf simplify more 2003-05-18 02:07:20 +00:00
itojun ebf587df1a simplify by strlcpy/cat 2003-05-18 02:06:28 +00:00
lukem ea56af7b9d Tweak behaviour introduced in rev 1.50;
*	by default, warning messages go to stderr
    *	if -A or -a is used, send warning messages to stdout instead.

The behaviour in 1.50 meant that
	somevar=`sysctl -n machdep.booted_kernel 2>/dev/null`
could end up with $somevar="machdep.booted_kernel: the value is not available"
rather than the more useful $somevar="".

(This way, "sysctl -A | grep ..." is still useful.)
2003-04-06 05:19:03 +00:00
fvdl 74cc14e0d0 Quell formwat warning for LP64 for the diskinfo printf. 2003-03-07 00:42:04 +00:00
dsl 2ac00e9169 display machdep.diskinfo for i386 and x86_84
(agreed by christos)
2003-01-22 17:12:41 +00:00
manu 41bfbd28fe On Darwin, mach_init is the system bootstrap process. It is responsible
for forking the traditional UNIX init(8) and it does the Mach port naming
service. We need mach_init for the naming service, but unfortunately, it
will only act as such if its PID is 1. We introduce a sysctl
(emul.darwin.init_pid) to fool a given process into thinking its PID is 1.
That way we can get mach_init into behaving as the name server.

Typical use:
/sbin/sysctl -w emul.darwin.init_pid=$$ ; exec /emul/darwin/sbin/mach_init
2002-12-24 12:15:45 +00:00
lukem d348d3d723 tweaks for fparseln(3) move from libutil to libc:
- remove #include <util.h> if nothing else needed it
- remove LDFLAGS+=-lutil if nothing else needed it
2002-11-30 03:10:53 +00:00
manu 99bc517790 Added sysctl to change all IRIX kernel values reported by uname and systeminfo:
OS name, hw name, kernel version, and so forth.
2002-11-09 09:03:56 +00:00
simonb f8c2d639ce When printing out nodes of type "string", don't print anything if
sysctl() reports that 0 bytes were returned.

Reported by Matt Green with "sysctl hw.disknames" on a system with no
disks.
2002-11-03 07:06:06 +00:00
sommerfeld 1803fb93a9 Add -q flag, for use with -w and -f, which suppresses output after a set. 2002-03-24 00:11:00 +00:00
christos 412e9e63d4 remove debugging line. 2002-03-20 00:29:24 +00:00
christos 58d461858a handle new emulation sysctls, and cleanup function duplication. 2002-03-20 00:23:23 +00:00
christos 373820b6f3 fix inconsistencies with USEAPP; centralize the flags check so that we
don't have to deal with it in the future.
2002-01-31 20:15:14 +00:00
simonb 3860ddc415 Descend into kern.tkstat. 2002-01-28 02:07:40 +00:00
simonb 750526acc6 ANSIfy. 2002-01-28 01:37:17 +00:00
simonb 8e6a975576 Fix a tyop in a comment. 2002-01-27 23:50:36 +00:00
simonb 93f270352c Teach sysctl(8) that hw.diskstats is a structure. 2002-01-27 12:47:37 +00:00
lukem 6de0e99d81 change a lot of the "error" messages to display to stdout instead of
stderr, so that "sysctl -A" output is actually usable.  requested by perry
2001-12-24 01:30:38 +00:00
itojun 153665ad26 show net.inet6.tcp6.* as mirror image of net.inet.tcp. better for future
INET-less kernels.
2001-07-27 04:22:09 +00:00
jdolecek 0fe5bf8257 pipe sysctl stuff is now in <sys/pipe.h> 2001-07-02 20:55:16 +00:00
jdolecek ee882e3a09 Add port of high performance pipe implementation written by John S. Dyson
for FreeBSD project. Besides huge speed boost compared with socketpair-based
pipes, this implementation also uses pagable kernel memory instead of mbufs.

Significant differences to FreeBSD version:
* uses uvm_loan() facility for direct write
* async/SIGIO handling correct also for sync writer, async reader
* limits settable via sysctl, amountpipekva and nbigpipes available via sysctl
* pipes are unidirectional - this is enforced on file descriptor level
	for now only, the code would be updated to take advantage of it
	eventually
* uses lockmgr(9)-based locks instead of home brew variant
* scatter-gather write is handled correctly for direct write case, data
  is transferred by PIPE_DIRECT_CHUNK bytes maximum, to avoid running out of kva

All FreeBSD/NetBSD specific code is within appropriate #ifdef, in preparation
to feed changes back to FreeBSD tree.

This pipe implementation is optional for now, add 'options NEW_PIPE'
to your kernel config to use it.
2001-06-16 12:00:02 +00:00
chs 83d071a318 add UBC memory-usage balancing. we track the number of pages in use for
each of the basic types (anonymous data, executable image, cached files)
and prevent the pagedaemon from reusing a given page if that would reduce
the count of that type of page below a sysctl-setable minimum threshold.
the thresholds are controlled via three new sysctl tunables:
vm.anonmin, vm.vnodemin, and vm.vtextmin.  these tunables are the
percentages of pageable memory reserved for each usage, and we do not allow
the sum of the minimums to be more than 95% so that there's always some
memory that can be reused.
2001-03-09 01:02:10 +00:00
cgd 8a986b2e96 convert to use getprogname() 2001-02-19 22:48:57 +00:00
christos 252e11ea2b fix nested extern. 2001-02-04 21:13:12 +00:00
fvdl 4f289ff858 Number of toplevel names grew by one, account for it. 2001-01-09 21:31:02 +00:00
lukem f7650338ca use %ll_ instead of the less standard %q_ 2001-01-05 02:02:57 +00:00
enami 8db557a393 Free storage allocated by fparseln. 2000-07-19 10:05:43 +00:00
simonb a6273c2690 Handle KERN_MSGBUF and KERN_CONSDEV gracefully. 2000-07-15 07:07:02 +00:00
itojun c6910190d6 sync with sys/sysctl.h change (is it the right way to workaround this?) 2000-07-15 01:44:35 +00:00
mrg ad91bba6a6 we now need <uvm/uvm_param.h> 2000-06-26 15:37:26 +00:00
itojun 8183434ff7 s/PIMCTL/PIM6CTL/ to avoid future confusion. 2000-06-07 04:40:46 +00:00
matt b890d3f2ba LP64 format problems. u_int64_t on alpha != %llu 2000-05-29 21:42:12 +00:00
simonb c135b7f036 cp_time[] is an array of u_int64_t's now. 2000-05-29 11:59:01 +00:00
simonb 66f45159dc Handle kern.proc_args as well. 2000-05-27 15:30:12 +00:00
simonb 8bbe78e806 s/fprintf(stdout/printf(/ 2000-05-27 15:11:05 +00:00
simonb 732db039ce Deal with new structure returning sysctl()s. 2000-05-27 15:05:14 +00:00
simonb 1dd73382a3 Fix minor annoyance - when showing the boottime, the ctime() result
already has a trailing newline, so don't add an extra one.
2000-04-21 02:49:37 +00:00
simonb 48a5c3efa9 Don't declare 'extern opt*' getopt variables. 2000-04-14 05:58:01 +00:00
soren 59307a9107 Update usage with -f. 2000-04-08 23:18:27 +00:00
tsarna f8c6d57730 Fix warning. 2000-03-12 22:58:05 +00:00
tsarna 4f90f5ce45 Add a "-f file" flag to process directives from a file. 2000-03-12 22:56:48 +00:00
fvdl b02df6b9ee List vfs.generic.usermount in manpage. Don't try to handle machdep.diskinfo
for the i386, thus avoiding a warning message in 'sysctl -a'.
2000-02-17 08:54:16 +00:00
thorpej eb51db5e1e Support vm.nkmempages. 2000-02-12 18:00:58 +00:00
itojun 787fb293d3 fix include file path. 2000-02-06 11:12:40 +00:00
itojun 0af5938ca4 Moved from usr.sbin/sysctl/sysctl.c,v 2000-01-17 02:32:06 +00:00