summaryrefslogtreecommitdiffstats
path: root/include/kenv.h
diff options
context:
space:
mode:
authormux <mux@FreeBSD.org>2002-04-17 13:06:36 +0000
committermux <mux@FreeBSD.org>2002-04-17 13:06:36 +0000
commita207e41bef089b8849a230f44088a562d0b5d19f (patch)
treecb447f9f2a04a764ece9fcefc6fa6b52d19870b8 /include/kenv.h
parentc79270302c4767b589a4fe70da3ba9866936358f (diff)
downloadFreeBSD-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 '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 0000000..87f36f3
--- /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_ */
OpenPOWER on IntegriCloud