summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sysctl.c
Commit message (Collapse)AuthorAgeFilesLines
...
* KSE Milestone 2julian2001-09-121-18/+18
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Giant Pushdowndillon2001-09-011-11/+28
| | | | | | | | clock_gettime() clock_settime() nanosleep() settimeofday() adjtime() getitimer() setitimer() __sysctl() ogetkerninfo() sigaction() osigaction() sigpending() osigpending() osigvec() osigblock() osigsetmask() sigsuspend() osigsuspend() osigstack() sigaltstack() kill() okillpg() trapsignal() nosys()
* Fix the ogetkerninfo() syscall handling of sizes forpeter2001-08-291-10/+12
| | | | | | | | KINFO_BSDI_SYSINFO. This supposedly fixes Netscape 3.0.4 (bsdi binary) on -current. (and is also applicable to RELENG_4) PR: 25476 Submitted by: Philipp Mergenthaler <un1i@rz.uni-karlsruhe.de>
* Make dynamic sysctl entries start at 0x100, not decimal 100 - there areroam2001-07-251-3/+7
| | | | | | | | | | | | static entries with oid's over 100, and defining enough dynamic entries causes an overlap. Move the "magic" value 0x100 into <sys/sysctl.h> where it belongs. PR: 29131 Submitted by: "Alexander N. Kabaev" <kabaev@mail.ru> Reviewed by: -arch, -audit MFC after: 2 weeks
* Style(9): function names on a separate line, max line length 80 chars.roam2001-07-251-4/+8
| | | | | Reviewed by: -arch, -audit MFC after: 2 weeks
* int -> size_t fixmjacob2001-06-221-2/+2
|
* With this commit, I hereby pronounce gensetdefs past its use-by date.peter2001-06-131-22/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the a.out emulation of 'struct linker_set' with something a little more flexible. <sys/linker_set.h> now provides macros for accessing elements and completely hides the implementation. The linker_set.h macros have been on the back burner in various forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()), John Polstra (ELF clue) and myself (cleaned up API and the conversion of the rest of the kernel to use it). The macros declare a strongly typed set. They return elements with the type that you declare the set with, rather than a generic void *. For ELF, we use the magic ld symbols (__start_<setname> and __stop_<setname>). Thanks to Richard Henderson <rth@redhat.com> for the trick about how to force ld to provide them for kld's. For a.out, we use the old linker_set struct. NOTE: the item lists are no longer null terminated. This is why the code impact is high in certain areas. The runtime linker has a new method to find the linker set boundaries depending on which backend format is in use. linker sets are still module/kld unfriendly and should never be used for anything that may be modular one day. Reviewed by: eivind
* When tring to find out if this is a request for a write indd2001-06-031-2/+2
| | | | | kernel_sysctl and userland_sysctl, check for whether new is NULL, not whether newlen is 0. This allows one to set a string sysctl to "".
* Add convenience function kernel_sysctlbyname() for kernel consumers,jlemon2001-05-191-1/+24
| | | | so they don't have to roll their own sysctlbyname function.
* Make the SYSCTL_OUT handlers sysctl_old_user() and sysctl_old_kernel()tmm2001-03-081-4/+10
| | | | | | | | more robust. They would correctly return ENOMEM for the first time when the buffer was exhausted, but subsequent calls in this case could cause writes ouside of the buffer bounds. Approved by: rwatson
* Mechanical change to use <sys/queue.h> macro API instead ofphk2001-02-041-1/+1
| | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1)
* Remove unused variable 'int n;'peter2001-01-291-1/+0
|
* Never reuse AUTO_OID values.mckusick2001-01-241-7/+5
| | | | Approved by: Alfred Perlstein <bright@wintelcom.net>
* - For dynamic sysctl's added at runtime, don't assume that the name passedjhb2001-01-051-2/+2
| | | | | | | | to the SYSCTL_ADD_FOO() macros is a constant that should be turned into a string via the pre-processor. Instead, require it to be an explicit string so that names can be generated on the fly. - Make some of the char * arguments to sysctl_add_oid() const to quiet warnings.
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-2/+1
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* 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.
OpenPOWER on IntegriCloud