summaryrefslogtreecommitdiff
path: root/sys/kern/kern_environment.c
Commit message (Collapse)AuthorAgeFilesLines
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-6/+6
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-6/+6
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* remove syscallarg().Alfred Perlstein2002-12-141-4/+4
| | | | | | | Suggested by: peter Notes: svn path=/head/; revision=107850
* SCARGS removal take II.Alfred Perlstein2002-12-141-14/+14
| | | | Notes: svn path=/head/; revision=107849
* Backout removal SCARGS, the code freeze is only "selectively" over.Alfred Perlstein2002-12-131-14/+14
| | | | Notes: svn path=/head/; revision=107839
* Remove SCARGS.Alfred Perlstein2002-12-131-14/+14
| | | | | | | Reviewed by: md5 Notes: svn path=/head/; revision=107838
* Add MAC checks for various kenv() operations: dump, get, set, unset,Robert Watson2002-11-011-1/+23
| | | | | | | | | | permitting MAC policies to limit access to the kernel environment. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=106308
* Use strlcpy() instead of strncpy() to copy NUL terminated stringsRobert Drehmel2002-10-171-2/+1
| | | | | | | for safety and consistency. Notes: svn path=/head/; revision=105354
* Cosmetic tweaks. Try and keep the style more consistent, catch some strayPeter Wemm2002-05-011-42/+41
| | | | | | | whitespace and update a comment. Notes: svn path=/head/; revision=95839
* Fixed some longstanding bugs in _getenv_static():Bruce Evans2002-04-251-3/+4
| | | | | | | | | | | | | | | | - malformed environment strings (ones without an '=') were not rejected. There shouldn't be any of these, but when the static environment is empty it always begins with one of these; this one should be considered as the terminator after the end of the environment, but it isn't. - the comparison of the name being looked up with the name in the environment was fuzzy -- only the characters up to the length of the latter were compared, so _getenv_static("foobar") matched "foo=..." in the environment and everything matched "" in the empty environment. MFC after: 3 days Notes: svn path=/head/; revision=95467
* Avoid calling malloc() or free() while holding theMaxime Henrion2002-04-171-13/+26
| | | | | | | | | kenv lock. Reviewed by: jake Notes: svn path=/head/; revision=94959
* Rework the kernel environment subsystem. We now convert the staticMaxime Henrion2002-04-171-59/+308
| | | | | | | | | | | | | | | | | | | | environment needed at boot time to a dynamic subsystem when VM is up. The dynamic kernel environment is protected by an sx lock. This adds some new functions to manipulate the kernel environment : freeenv(), setenv(), unsetenv() and testenv(). freeenv() has to be called after every getenv() when you have finished using the string. testenv() only tests if an environment variable is present, and doesn't require a freeenv() call. setenv() and unsetenv() are self explanatory. The kenv(2) syscall exports these new functionalities to userland, mainly for kenv(1). Reviewed by: peter Notes: svn path=/head/; revision=94936
* Fix an inverted test csae. Success of getenv() is determined by a returnJohn Baldwin2001-10-251-1/+1
| | | | | | | | | | value of !NUL rather than NUL. Submitted by: luigi Pointy hat to: jhb Notes: svn path=/head/; revision=85493
* - Change getenv_quad() to return an int instead of a quad_t since itJohn Baldwin2001-10-231-1/+21
| | | | | | | | | returns an success/failure code rather than the actual value. - Add getenv_string() which copies a string from the environment to another string and returns true on success. Notes: svn path=/head/; revision=85385
* Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loaderPaul Saab2001-10-101-0/+8
| | | | | | | | | | tunable. Reviewed by: peter MFC after: 2 weeks Notes: svn path=/head/; revision=84783
* Add a pointer to kenv(1).Peter Wemm2001-09-211-0/+3
| | | | Notes: svn path=/head/; revision=83744
* Revert last commit. The same functionality can be obtained through theJonathan Lemon2001-09-211-26/+27
| | | | | | | 'kenv' command, which I obviously was unaware of. Notes: svn path=/head/; revision=83743
* Add a sysctl MIB 'kern.env', that dumps the contents of the kernelJonathan Lemon2001-09-201-27/+26
| | | | | | | | environment from the loader, as well as the kernel's compiled in static hints. Notes: svn path=/head/; revision=83737
* Fix some warnings in kern_environment.c. Make the getenv*() familyPeter Wemm2001-06-151-3/+3
| | | | | | | | | take a const 'name', since they dont modify anything. 159: warning: passing arg 1 of `getenv_int' discards qualifiers... 167: warning: passing arg 1 of `getenv' discards qualifiers from pointer.. Notes: svn path=/head/; revision=78247
* "Fix" the previous initial attempt at fixing TUNABLE_INT(). This timePeter Wemm2001-06-081-0/+15
| | | | | | | | | | around, use a common function for looking up and extracting the tunables from the kernel environment. This saves duplicating the same function over and over again. This way typically has an overhead of 8 bytes + the path string, versus about 26 bytes + the path string. Notes: svn path=/head/; revision=77900
* Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.Poul-Henning Kamp2000-07-041-1/+1
| | | | | | | Pointed out by: bde Notes: svn path=/head/; revision=62573
* Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:Poul-Henning Kamp2000-07-031-1/+1
| | | | | | | | | | | Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our sources: -sysctl_vm_zone SYSCTL_HANDLER_ARGS +sysctl_vm_zone (SYSCTL_HANDLER_ARGS) Notes: svn path=/head/; revision=62454
* Change the prototype of the strto* routines to make the secondArchie Cobbs1999-11-241-2/+3
| | | | | | | | | | | | | | parameter a char ** instead of a const char **. This make these kernel routines consistent with the corresponding libc userland routines. Which is actually 'correct' is debatable, but consistency and following the spec was deemed more important in this case. Reviewed by (in concept): phk, bde Notes: svn path=/head/; revision=53648
* add in actual getenv_quad functionMatt Jacob1999-11-071-1/+17
| | | | Notes: svn path=/head/; revision=52947
* Trim unused options (or #ifdef for undoc options).Peter Wemm1999-10-111-1/+0
| | | | | | | Submitted by: phk Notes: svn path=/head/; revision=52128
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Fix warnings related to -Wall -Wcast-qualMatthew Dillon1999-01-281-2/+2
| | | | Notes: svn path=/head/; revision=43351
* Fix getenv() comparison against '=' ... was *cp = '=' instead ofMatthew Dillon1999-01-271-2/+2
| | | | | | | *cp == '='. Notes: svn path=/head/; revision=43299
* Add getenv_int(), specifically for retrieving integer values from kernelMike Smith1999-01-151-1/+20
| | | | | | | | environment variables. This makes it easy to pass tuning parameters in from the bootloader. Notes: svn path=/head/; revision=42706
* Don't try to initialise the environment out of a sysinit, it's handledMike Smith1998-10-091-10/+1
| | | | | | | in MD code instead. Notes: svn path=/head/; revision=40131
* Fix damaged comment.Jordan K. Hubbard1998-10-091-1/+2
| | | | Notes: svn path=/head/; revision=40116
* Kernel environment access, preloaded module lookup.Mike Smith1998-10-091-0/+126
Notes: svn path=/head/; revision=40090