aboutsummaryrefslogtreecommitdiffstats
path: root/include/kenv.h
diff options
context:
space:
mode:
authorMaxime Henrion <mux@FreeBSD.org>2002-04-17 13:06:36 +0000
committerMaxime Henrion <mux@FreeBSD.org>2002-04-17 13:06:36 +0000
commitd786139c76ad8d7cd25f962f7e67d4af98685418 (patch)
treecb447f9f2a04a764ece9fcefc6fa6b52d19870b8 /include/kenv.h
parentfd448168b76dbe56823963e1d17872d0673e13ca (diff)
downloadsrc-d786139c76ad8d7cd25f962f7e67d4af98685418.tar.gz
src-d786139c76ad8d7cd25f962f7e67d4af98685418.zip
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
Notes
Notes: svn path=/head/; revision=94936
Diffstat (limited to 'include/kenv.h')
-rw-r--r--include/kenv.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/kenv.h b/include/kenv.h
new file mode 100644
index 000000000000..87f36f33c94a
--- /dev/null
+++ b/include/kenv.h
@@ -0,0 +1,39 @@
+/*-
+ * Copyright (c) 2002 Maxime Henrion <mux@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _KENV_H_
+#define _KENV_H_
+
+#include <sys/cdefs.h>
+#include <sys/kenv.h>
+
+__BEGIN_DECLS
+int kenv(int, char *, char *, int);
+__END_DECLS
+
+#endif /* !_KENV_H_ */