aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src
diff options
context:
space:
mode:
authorMartin Hässler <[email protected]>2013-11-09 21:04:06 +0100
committerMartin Hässler <[email protected]>2013-11-09 21:04:06 +0100
commit7b739330bb459401f9c11f0f84912aedc7ee22cd (patch)
treee1ffbca9adb63a1132c6c8af8236b725a8c5da56 /lib/kernel/src
parent768a64354e3d69b3c0840a84dd072601c67ca39d (diff)
downloadotp-7b739330bb459401f9c11f0f84912aedc7ee22cd.tar.gz
otp-7b739330bb459401f9c11f0f84912aedc7ee22cd.tar.bz2
otp-7b739330bb459401f9c11f0f84912aedc7ee22cd.zip
Add os:unsetenv/1
New BIF os:unsetenv/1 which deletes an environment variable and returns 'true'. Does not change any old functionality. Calls the libc function unsetenv(3) on UNIX and SetEnvironmentVariableW(key, NULL) on Windows. The unicode support is the same as for os:getenv and os:putenv.
Diffstat (limited to 'lib/kernel/src')
-rw-r--r--lib/kernel/src/os.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/kernel/src/os.erl b/lib/kernel/src/os.erl
index ded03361ee..9415593485 100644
--- a/lib/kernel/src/os.erl
+++ b/lib/kernel/src/os.erl
@@ -26,7 +26,7 @@
%%% BIFs
--export([getenv/0, getenv/1, getpid/0, putenv/2, timestamp/0]).
+-export([getenv/0, getenv/1, getpid/0, putenv/2, timestamp/0, unsetenv/1]).
-spec getenv() -> [string()].
@@ -58,6 +58,12 @@ putenv(_, _) ->
timestamp() ->
erlang:nif_error(undef).
+-spec unsetenv(VarName) -> true when
+ VarName :: string().
+
+unsetenv(_) ->
+ erlang:nif_error(undef).
+
%%% End of BIFs
-spec type() -> {Osfamily, Osname} when