aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-11-18 09:37:42 +0100
committerFredrik Gustafsson <[email protected]>2013-11-18 09:37:42 +0100
commitb2e4599affa6718bba60ef3846d130513e9a740d (patch)
tree116115e2a365d204eb7b1ffc706ad8a9c69bf3fa /lib
parentf07816ab2826d2a4082442f1d8ca71b7bfb89a47 (diff)
parent22c39699f35142063f69c45bdb919bcba468fede (diff)
downloadotp-b2e4599affa6718bba60ef3846d130513e9a740d.tar.gz
otp-b2e4599affa6718bba60ef3846d130513e9a740d.tar.bz2
otp-b2e4599affa6718bba60ef3846d130513e9a740d.zip
Merge branch 'mhssler/add-os-unsetenv/OTP-11446' into maint
* mhssler/add-os-unsetenv/OTP-11446: erts: remove ?line macro in testcases Update primary bootstrap Add os:unsetenv/1
Diffstat (limited to 'lib')
-rw-r--r--lib/kernel/doc/src/os.xml11
-rw-r--r--lib/kernel/src/os.erl8
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/kernel/doc/src/os.xml b/lib/kernel/doc/src/os.xml
index 5e182de41d..9122267c40 100644
--- a/lib/kernel/doc/src/os.xml
+++ b/lib/kernel/doc/src/os.xml
@@ -177,6 +177,17 @@ format_utc_timestamp() ->
</desc>
</func>
<func>
+ <name name="unsetenv" arity="1"/>
+ <fsummary>Delete an environment variable</fsummary>
+ <desc>
+ <p>Deletes the environment variable <c><anno>VarName</anno></c>.</p>
+ <p>If Unicode filename encoding is in effect (see the <seealso
+ marker="erts:erl#file_name_encoding">erl manual
+ page</seealso>), the string (<c><anno>VarName</anno></c>) may
+ contain characters with codepoints > 255.</p>
+ </desc>
+ </func>
+ <func>
<name name="version" arity="0"/>
<fsummary>Return the Operating System version</fsummary>
<desc>
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