summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sysctl.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix some style nits.peter2000-07-281-10/+13
| | | | Fix(?) some compile warnings regarding const handling.
* These patches implement dynamic sysctls. It's possible now to addabial2000-07-151-0/+252
| | | | | | | | | | | | | | | | | | | | | | and remove sysctl oids at will during runtime - they don't rely on linker sets. Also, the node oids can be referenced by more than one kernel user, which means that it's possible to create partially overlapping trees. Add sysctl contexts to help programmers manage multiple dynamic oids in convenient way. Please see the manpages for detailed discussion, and example module for typical use. This work is based on ideas and code snippets coming from many people, among them: Arun Sharma, Jonathan Lemon, Doug Rabson, Brian Feldman, Kelly Yancey, Poul-Henning Kamp and others. I'd like to specially thank Brian Feldman for detailed review and style fixes. PR: kern/16928 Reviewed by: dfr, green, phk
* Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.phk2000-07-041-11/+11
| | | | Pointed out by: bde
* Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:phk2000-07-031-11/+11
| | | | | | | | Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our sources: -sysctl_vm_zone SYSCTL_HANDLER_ARGS +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
* Back out the previous change to the queue(3) interface.jake2000-05-261-1/+1
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-1/+1
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Remove unneeded <sys/buf.h> includes.phk2000-04-181-1/+0
| | | | | Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks by 924 bytes.
* Remove unused 3rd argument from vsunlock() which abused B_WRITE.phk2000-03-131-2/+2
|
* Separate some common sysctl code into sysctl_find_oid() and callinggreen1999-12-011-68/+65
| | | | | thereof. Also, make the errno returns _correct_, and add a new one which is more appropriate.
* Change useracc() and kernacc() to use VM_PROT_{READ|WRITE|EXECUTE} for thephk1999-10-301-2/+2
| | | | | | | | | "rw" argument, rather than hijacking B_{READ|WRITE}. Fix two bugs (physio & cam) resulting by the confusion caused by this. Submitted by: Tor.Egge@fast.no Reviewed by: alc, ken (partly)
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Minor tweaks to make sure (new) prerequisites for <sys/buf.h> (mostlypeter1999-06-271-3/+3
| | | | splbio()/splx()) are #included in time.
* This Implements the mumbled about "Jail" feature.phk1999-04-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a seriously beefed up chroot kind of thing. The process is jailed along the same lines as a chroot does it, but with additional tough restrictions imposed on what the superuser can do. For all I know, it is safe to hand over the root bit inside a prison to the customer living in that prison, this is what it was developed for in fact: "real virtual servers". Each prison has an ip number associated with it, which all IP communications will be coerced to use and each prison has its own hostname. Needless to say, you need more RAM this way, but the advantage is that each customer can run their own particular version of apache and not stomp on the toes of their neighbors. It generally does what one would expect, but setting up a jail still takes a little knowledge. A few notes: I have no scripts for setting up a jail, don't ask me for them. The IP number should be an alias on one of the interfaces. mount a /proc in each jail, it will make ps more useable. /proc/<pid>/status tells the hostname of the prison for jailed processes. Quotas are only sensible if you have a mountpoint per prison. There are no privisions for stopping resource-hogging. Some "#ifdef INET" and similar may be missing (send patches!) If somebody wants to take it from here and develop it into more of a "virtual machine" they should be most welcome! Tools, comments, patches & documentation most welcome. Have fun... Sponsored by: http://www.rndassociates.com/ Run for almost a year by: http://www.servetheweb.com/
* Suser() simplification:phk1999-04-271-2/+2
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Purging lint from the Bruce filter.phk1999-03-301-12/+10
|
* Fix some nasty hangs if garbage were passed.phk1999-03-231-4/+6
| | | | | Noticed by: Emmanuel DELOGET <pixel@DotCom.FR> Remembered by: msmith
* * Change sysctl from using linker_set to construct its tree using SLISTs.dfr1999-02-161-174/+157
| | | | | | | | | | This makes it possible to change the sysctl tree at runtime. * Change KLD to find and register any sysctl nodes contained in the loaded file and to unregister them when the file is unloaded. Reviewed by: Archie Cobbs <archie@whistle.com>, Peter Wemm <peter@netplex.com.au> (well they looked at it anyway)
* Back out last change to sysctl.phk1999-01-101-47/+2
| | | | | | | | | | | | | | | | | | | | | | | It was nay'ed before committing on the grounds that this is not the way to do it, and has been decided as such several times in the past. There is not point in loading gobs of ascii into the kernel when the only use of that ascii is presentation to the user. Next thing we'd be adding all section 4 man pages to the loaded kernel as well. The argument about KLD's is bogus, klds can store a file in /usr/share/doc/sysctl/dev/foo/thisvar.txt with a description and sysctl or other facilities can pick it up there. Proper documentation will take several K worth of text for many sysctl variables, we don't want that in the kernel under any circumstances. I will welcome any well thought out attempt at improving the situation wrt. sysctl documentation, but this wasn't it.
* Add kernel support for sysctl descriptions. The NO_SYSCTL_DESCRIPTIONS optiondes1999-01-101-3/+48
| | | | | | | disables them if they're not wanted; in that case, sysctl_sysctl_descr will always return an empty string. Apporved by: jkh
* Fix some 64bit truncation problems which crept into SYSCTL_LONG() with thedfr1998-12-271-34/+4
| | | | | | | | last cleanup. Since the oid_arg2 field of struct sysctl_oid is not wide enough to hold a long, the SYSCTL_LONG() macro has been modified to only support exporting long variables by pointer instead of by value. Reviewed by: bde
* Add a generic flag, CTLFLAG_SECURE, which can be used to mark a sysctltruckman1998-12-131-2/+3
| | | | | variable unwriteable when securelevel > 0. Reviewed by: jdp, eivind
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()archie1998-12-041-2/+2
| | | | | | | | | | | | | | for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc. These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
* *gulp*. Jordan specifically OK'ed this..peter1998-10-161-1/+3
| | | | | | | | This is the bulk of the support for doing kld modules. Two linker_sets were replaced by SYSINIT()'s. VFS's and exec handlers are self registered. kld is now a superset of lkm. I have converted most of them, they will follow as a seperate commit as samples. This all still works as a static a.out kernel using LKM's.
* Ignore the statically configured vfs type numbers and assign vfsbde1998-09-051-2/+10
| | | | | | | | | | | type numbers in vfs attach order (modulo incomplete reuse of old numbers after vfs LKMs are unloaded). This requires reinitializing the sysctl tree (or at least the vfs subtree) for vfs's that support sysctls (currently only nfs). sysctl_order() already handled reinitialization reasonably except it checked for annulled self references in the wrong place. Fixed sysctls for vfs LKMs.
* Fixed bogotification of pseudocode for syscall args by rev.1.53 ofbde1998-09-051-2/+2
| | | | syscalls.master.
* Change various syscalls to use size_t arguments instead of u_int.dfr1998-08-241-13/+73
| | | | | | | | | | Add some overflow checks to read/write (from bde). Change all modifications to vm_page::flags, vm_page::busy, vm_object::flags and vm_object::paging_in_progress to use operations which are not interruptable. Reviewed by: Bruce Evans <bde@zeta.org.au>
* Make COMPAT_43 and COMPAT_SUNOS new-style options.eivind1997-12-161-1/+3
|
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-4/+4
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.phk1997-10-121-2/+2
| | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde
* Distribute and statizice a lot of the malloc M_* types.phk1997-10-111-1/+3
| | | | Substantial input from: bde
* Include <sys/buf.h> instead of <sys/vnode.h>. kern_sysctl.c nobde1997-04-091-2/+2
| | | | | | | longer has anything to do with vnodes and never had anything to do with buffers, but it needs the definitions of B_READ and B_WRITE for use with the bogus useracc() interface and was getting them bogusly due to excessive cleanups in rev.1.49.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-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.
* Fixed garbage being returned for constant int values, e.g., forbde1996-12-151-2/+2
| | | | | | | | | KERN_SAVED_IDS. Should be in 2.2. Reviewed by: phk Found by: NIST-PCTS
* Fixed bogus casts (const on the wrong `*' in `**') in a qsort-comparisionbde1996-09-031-4/+5
| | | | function.
* Don't depend in the kernel on the gcc feature of doing arithmetic onbde1996-08-311-5/+6
| | | | pointers of type `void *'. Warn about this in future.
* Implemented 'kern_sysctl', which differs from 'userland_sysctl' in thatnate1996-06-101-5/+63
| | | | | | | | | | | | it assumes all of the data exists in the kernel. Also, fix sysctl_new-kernel (unused until now) which had reversed operands to bcopy(). Reviewed by: phk Poul writes: ... actually the lock/sleep/wakeup cruft shouldn't be needed in the kernel version I think, but just leave it there for now.
* If handler function returns EAGAIN, restart operation.phk1996-06-061-3/+7
|
* Fix a longstanding bug and a buglet of no significance.phk1996-04-131-23/+18
| | | | | | Now net.ipx works. Noticed by: John Hay -- John.Hay@csir.co.za
* Move the "mib" variables out to their own file.phk1996-04-071-136/+6
|
* From Lite2: rename fs to vfs.hsu1996-03-111-2/+2
| | | | Reviewed by: davidg & bde
* Fix the reversed source and dest args to bcopy() in the kernel spacepeter1996-01-011-2/+2
| | | | | | | | sysctl handler (ouch!) Add a "const" qualifier to the source of the copyin() and copyout() functions - the other const warning in kern_sysctl.c was silenced when copyout was declared as having a const source.. (which it is)
* Add an obscure feature, needed for debugging.phk1995-12-171-9/+11
|
* A Major staticize sweep. Generates a couple of warnings that I'll dealphk1995-12-141-3/+3
| | | | | | with later. A number of unused vars removed. A number of unused procs removed or #ifdefed.
* Untangled the vm.h include file spaghetti.dg1995-12-071-1/+4
|
* A couple of minor tweaks to the sysctl stuff.phk1995-12-061-12/+48
|
* Include <vm/vm.h> or <vm/vm_page.h> explicitly to avoid breaking whenbde1995-12-051-1/+3
| | | | vnode_if.h doesn't include vm stuff.
* A major sweep over the sysctl stuff.phk1995-12-041-80/+332
| | | | | | | | | | | | | Move a lot of variables home to their own code (In good time before xmas :-) Introduce the string descrition of format. Add a couple more functions to poke into these marvels, while I try to decide what the correct interface should look like. Next is adding vars on the fly, and sysctl looking at them too. Removed a tine bit of defunct and #ifdefed notused code in swapgeneric.
* Mega commit for sysctl.phk1995-11-201-366/+107
| | | | | | Convert the remaining sysctl stuff to the new way of doing things. the devconf stuff is the reason for the large number of files. Cleaned up some compiler warnings while I were there.
* All net.* sysctl converted now.phk1995-11-161-4/+1
|
OpenPOWER on IntegriCloud