diff options
author | mux <mux@FreeBSD.org> | 2002-04-17 13:06:36 +0000 |
---|---|---|
committer | mux <mux@FreeBSD.org> | 2002-04-17 13:06:36 +0000 |
commit | a207e41bef089b8849a230f44088a562d0b5d19f (patch) | |
tree | cb447f9f2a04a764ece9fcefc6fa6b52d19870b8 /sys/ia64 | |
parent | c79270302c4767b589a4fe70da3ba9866936358f (diff) | |
download | FreeBSD-src-a207e41bef089b8849a230f44088a562d0b5d19f.zip FreeBSD-src-a207e41bef089b8849a230f44088a562d0b5d19f.tar.gz |
Rework the kernel environment subsystem. We now convert the static
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
Diffstat (limited to 'sys/ia64')
-rw-r--r-- | sys/ia64/ia64/machdep.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index dbd66e4..95d18fa 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -479,6 +479,7 @@ ia64_init(u_int64_t arg1, u_int64_t arg2) if (strcmp(p, "yes") == 0 || strcmp(p, "YES") == 0) { boothowto |= RB_VERBOSE; } + freeenv(p); } if (boothowto & RB_VERBOSE) @@ -543,8 +544,10 @@ ia64_init(u_int64_t arg1, u_int64_t arg2) init_param1(); p = getenv("kernelname"); - if (p) + if (p) { strncpy(kernelname, p, sizeof(kernelname) - 1); + freeenv(p); + } kernstartpfn = atop(IA64_RR_MASK(kernstart)); kernendpfn = atop(IA64_RR_MASK(kernend)); |