summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sysctl.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Add new KERN_PROC_CWD sysctl to get the current working directory of a process.nicm2011-12-091-1/+67
| | | | ok guenther deraadt
* Do not use the `hh' modifier in printf format strings, as the kernel printfmiod2011-09-181-3/+3
| | | | | implementation does not support it and handles it as `h'. ok jsing@
* Make sysctl__string() handle the truncated output case via twoguenther2011-09-181-8/+6
| | | | | | | copyout()s instead of altering the in-use variable, and to also return the full length via oldlenp in that case as documented. ok jsing@ (problem pointed out by matthew@)
* Recommit the reverted sigacts change now that the NFS use-after-freeguenther2011-07-051-2/+3
| | | | | | | | problem has been tracked down. This fixes the sharing of the signal handling state: shared bits go in sigacts, per-rthread bits goes in struct proc. ok deraadt@
* Make KERN_FILE and KERN_FILE2 behavior consistent: when the caller doesn'tguenther2011-06-271-3/+5
| | | | | | have the necessary rights, return f_offset=-1 and f_seek=0. ok tedu@, matthew@
* machdep.kbdreset enables a shutdown by Ctrl-Alt-Del on amd64 andnaddy2011-06-241-1/+8
| | | | | | | | | | | | | | | i386. Stop abusing it on other archs for controling a shutdown by pressing the soft power button: * Add a MI sysctl hw.allowpowerdown; if set to 1 (the default) it allows a power button shutdown. * Make acpi(4)/acpibtn(4) honor hw.allowpowerdown. * Switch the various power button intercepts on landisk, sgi, sparc64 and zaurus over to hw.allowpowerdown. * Garbage collect the machdep.kbdreset sysctl on all archs other than amd64 and i386. ok miod@
* Don't copy the first octet of the source IPv6 address where the destinationsthen2011-06-091-2/+2
| | | | | | | address should be, fixes broken fstat output for v6 socket connections. Problem noticed by dhill@, ok todd@, "i have no idea what that diff is touching, but it sure looks ok" halex@
* Revert the sigacts diff: NFS can apparently retain pointers to processesguenther2011-04-181-3/+2
| | | | | | until they're zombies and then send them signals (for intr mounts). Until that is untangled, the sigacts change is unsafe. sthen@ was the victim for this one
* Correct the sharing of the signal handling state: stuff that shouldguenther2011-04-151-2/+3
| | | | | | | | | | | | be shared (p_sigignore, p_sigcatch, P_NOCLDSTOP, P_NOCLDWAIT) moves to struct sigacts, wihle stuff that should be per rthread (ps_oldmask, SAS_OLDMASK, ps_sigstk) moves to struct proc. Treat the coredumping state bits (ps_sig, ps_code, ps_type, ps_sigval) as per-rthread until our locking around coredumping is better. Oh, and remove the old SunOS-compat ps_usertramp member. "I like the sound of this" tedu@
* sysctl kern.pool_debug=0 will disable POOL_DEBUG on the fly (still defaultsderaadt2011-04-041-1/+11
| | | | | | | | | to on, if POOL_DEBUG is compiled in, so that boot-time pool corruption can be found. When the sysctl is turned off, performance is almost as as good as compiling with POOL_DEBUG compiled out. Not all pool page headers can be purged of the magic checks. performance tests by henning ok ariane kettenis mikeb
* Constrain the buffer cache to use only the dma reachable region of memory.beck2011-04-021-2/+4
| | | | | | With this change bufcachepercent will be the percentage of dma reachable memory that the buffer cache will attempt to use. ok deraadt@ thib@ oga@
* Replace the old, broken KERN_PROC ABI and its matching functionsguenther2011-03-121-125/+34
| | | | | | | | | in libkvm with the stable-ABI versions that are currently named KERN_PROC2, kvm_get{proc,argv,envv}2(). The latter names and symbols will continue to be supported for a few releases. Committing now that they ports people have had a couple releases to update pkgs that usd the old functions
* allow users to enable access to the /dev/crypto, but keep it turned offmikeb2011-02-161-7/+1
| | | | by default, adjust comments in sysctl.conf; ok markus, tedu, djm, miod
* disable access to the crypto(4) device from userland; ok deraadtmikeb2010-12-141-1/+7
|
* Make KERN_CPTIME return an avarage number of ticks across all CPUsmikeb2010-11-191-1/+4
| | | | tedu agreed with an idea, tested by Luis Useche and me; ok deraadt
* export the network livelock counter. part of a diff i committed thedlg2010-11-021-1/+4
| | | | | | userland side of. pointed out by claudio@ after i embarassed myself saying "yes, its there!"
* Include the disklabel UID in hw.disknames.jsing2010-09-231-5/+21
| | | | ok deraadt@ krw@
* Introduce an MI kern.consdev sysctl that will replace the MDkettenis2010-08-191-1/+10
| | | | | | machdep.console_device that's only implemented on a few architectures. ok deraadt@, miod@
* Correct the links between threads, processes, pgrps, and sessions,guenther2010-07-261-22/+26
| | | | | | | | | so that the process-level stuff is to/from struct process and not struct proc. This fixes a bunch of problem cases in rthreads. Based on earlier work by blambert and myself, but mostly written at c2k10. Tested by many: deraadt, sthen, krw, ray, and in snapshots
* Rollback the allproclk and fileheadlk addition. When grabbing anguenther2010-07-191-26/+5
| | | | | | | | rwlock, the thread will release biglock if it sleeps, means that atomicity from before the rw_enter() to after it is not guaranteed. The change didn't address those, so pulling it until it does. "go for it" tedu@
* A process on the zombie list can have a NULL p_pgrp if it sleeps whenguenther2010-07-101-1/+6
| | | | | | | grabbing allproclk in proc_zap(); skip such processes in sysctl(KERN_PROC*) and handle the NULL pointer in ddb's ps. ok tedu@
* Since fill_eproc() is no longer called from coredump(), it can be droppedguenther2010-07-021-5/+1
| | | | | from small kernels "yes" deraadt@
* Add getsockopt SOL_SOCKET SO_PEERCRED support. This behaves similar toderaadt2010-06-301-1/+2
| | | | | | | getpeereid(2), but also supplies the remote pid. This is supplied in a 'struct sockpeercred' (unlike Linux -- they showed how little they know about real unix by calling theirs 'struct ucred'). ok guenther ajacoutot
* Fail instead of lying if a process asks sysctl()'s KERN_PROC2 orguenther2010-06-291-3/+4
| | | | | | | KERN_FILE2 (or their libkvm wrappers) for more information than the running implementation knows how to provide. ok millert@ deraadt@
* Eliminate RTHREADS kernel option in favor of a sysctl. The actual statustedu2010-06-291-1/+6
| | | | | (not done) hasn't changed, but now it's less work to test things. ok art deraadt
* Skip exiting procesess in sysctl_file2(). As processes in exit1()thib2010-06-191-7/+7
| | | | | | | | | do a pdfree() way before they remove themself from the allproc list. This prevents a null deref found by todd@. Joint work with mikeb OK millert@, tedu@
* Use intermediate vaddr_t cast when casting a pointer to off_t. Preventskettenis2010-05-021-2/+2
| | | | | | | gcc4 from complaining about casting a pointer to an integer type of different size. ok guenther@, jsg@
* Get rid of MAXSENSORDEVICES. Gaps in sensordev lists are now handledderaadt2010-04-201-7/+7
| | | | | | | by returning ENXIO instead of ENOENT, to essentially indicate hotplug sensor that has gone away. Accessing beyond the end of the sensordev list still returns ENOENT, so that you can see there are no further devices. ok kettenis oga
* Add a rwlock around the filehead and allproc lists, mainly to protecttedu2010-03-241-5/+26
| | | | | list walkers in sysctl that can block. As a reward, no more vslock. With some feedback from art, guenther, phessler. ok guenther.
* Reimplement kvm_getproc2()'s support for reading crash dumps andguenther2010-01-101-129/+9
| | | | | | | | | | | | | | /dev/mem to be direct instead of going through kvm_getprocs(), as that function is going to get more an more broken as we move stuff from struct proc to struct process for rthreads. To minimize the code copying, put the common logic of filling in a kinfo_proc2 structure into a macro FILL_KPROC2() in <sys/sysctl.h> for use from both the kernel and user-space. This also hides the KERN_PROC #define behind "#if defined(_KERNEL)||defined(_LIBKVM)", as it's deprecated. Positive feedback from millert and blambert; so committing to unblock further rthreads work.
* Rototill system V message queues.blambert2009-08-091-19/+2
| | | | | | | | | | No longer allocate a static amount of memory for messages in MD boot path; message queues, message metadata, and message data now all use dynamic memory, which means that runtime sysctls should now be trivial to implement. Since I'm going to be around all week to fix any breakage, this should probably just go in now.
* Dynamic buffer cache support - a re-commit of what was backed outbeck2009-08-021-4/+13
| | | | | | | | after c2k9 allows buffer cache to be extended and grow/shrink dynamically tested by many, ok oga@, "why not just commit it" deraadt@
* Handle the case where so_pcb is NULL.millert2009-07-211-1/+3
|
* Hook up "text" (executable) output and implement for fuser too.millert2009-07-191-1/+3
| | | | Man page bits adapted from FreeBSD. OK miod@
* No you cannot remove a sysctl mib once you add it. It becomes ABI. Thatderaadt2009-06-151-1/+10
| | | | | is how sysctl finds them, so it can *never* be renumbered again, and must stay
* Back out all the buffer cache changes I committed during c2k9. This reverts threebeck2009-06-151-19/+1
| | | | | | | | | | commits: 1) The sysctl allowing bufcachepercent to be changed at boot time. 2) The change moving the buffer cache hash chains to a red-black tree 3) The dynamic buffer cache (Which depended on the earlier too). ok on the backout from marco and todd
* some vnodes have a NULL mountpoint, so strlcpy of the f_mntonname if not advisedderaadt2009-06-081-3/+5
|
* Add KERN_FILE2 sysctl analogous to KERN_PROC2 but for file structures,millert2009-06-071-3/+296
| | | | | along with vnode type-specific info to make it more useful for fstat(1). OK deraadt@
* Dynamic buffer cache sizing.beck2009-06-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | This commit won't change the default behaviour of the system unless the buffer cache size is increased with sysctl kern.bufcachepercent. By default our buffer cache is 10% of memory, which with this commit is now treated as a low water mark. If the buffer cache size is increased, the new size is treated as a high water mark and the buffer cache is permitted to grow to that percentage of memory. If the page daemon is invoked, the page daemon will ask the buffer cache to relenquish pages. if the buffer cache has more than the low water mark it will relenquish pages allowing them to be consumed by uvm. after a short period the buffer cache will attempt to re-grow back to the high water mark. This permits the use of a large buffer cache without penalizing the available memory for other purposes. Above the low water mark the buffer cache remains entirely subservient to the page daemon, so if uvm requires pages, the buffer cache will abandon them. ok art@ thib@ oga@
* add kern.bufcachepercent sysctl to allow adjusting the buffer cachebeck2009-06-031-1/+18
| | | | | size on a running system. ok art@, oga@
* Count number of cpus found (potentially not attached) and store thatderaadt2009-04-191-1/+3
| | | | in sysctl hw.ncpufound; ok miod kettenis
* Pass the new pointer to sysctl_clockrate(), so that trying to change themiod2009-01-211-2/+2
| | | | | value of kern.clockrate with sysctl(3) correctly sets errno on failure. PR #6040, ok tedu@
* Do not assume that a pointer to another process will live over a set ofderaadt2008-10-311-11/+12
| | | | | | sleeping calls. Since we are simply operating on another process' vmspace, grab a (refcounted) copy of that pointer and use that instead. originally spotted by kurt, discussed with art
* accidental commit ... backoutderaadt2008-10-311-12/+11
|
* kern_sysctl.cderaadt2008-10-311-11/+12
|
* pass NULL rather than 0 for interrupt time usage to calcru()kevlo2008-10-091-2/+2
| | | | ok art@
* Do not display file offsets and a few other pieces of information, exceptderaadt2008-10-071-5/+16
| | | | | | to the user or the superuser. Display * for those fields instead. From PR 5113, but modified to use copyout correctly. comments from tedu, ok from others
* rename arc4random_bytes => arc4random_buf to match libc's nicer name;djm2008-06-091-2/+2
| | | | ok deraadt@
* Introduce HW_PHYSMEM64 and HW_USERMEM64 sysctls, which don't overflow onkettenis2008-02-091-1/+7
| | | | | | | machines with more than 4GB of memory. Make sysctl(8) print values obtained using these sysctls for hw.physmem and hw.usermem. ok krw@, miod@
* protect the disk statistics with a mutex.dlg2007-12-231-1/+5
| | | | ok tedu@ kettenis@