diff options
author | Micael Karlberg <[email protected]> | 2018-06-11 18:14:42 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2018-09-18 14:50:18 +0200 |
commit | 8c6d495f54207d019e645e5ff726418677f92ab9 (patch) | |
tree | 65ad0c63c4949a8ba43d5ca51513cdc2cb9a95c7 /erts/preloaded/src/net.erl | |
parent | f2a28200a826af65596bb554b014d2c93b6314a7 (diff) | |
download | otp-8c6d495f54207d019e645e5ff726418677f92ab9.tar.gz otp-8c6d495f54207d019e645e5ff726418677f92ab9.tar.bz2 otp-8c6d495f54207d019e645e5ff726418677f92ab9.zip |
[net-nif] Implemented gethostname
Diffstat (limited to 'erts/preloaded/src/net.erl')
-rw-r--r-- | erts/preloaded/src/net.erl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/erts/preloaded/src/net.erl b/erts/preloaded/src/net.erl index 54b3790dd5..823f11e2b8 100644 --- a/erts/preloaded/src/net.erl +++ b/erts/preloaded/src/net.erl @@ -28,6 +28,7 @@ ]). -export([ + gethostname/0, getnameinfo/1, getnameinfo/2, getaddrinfo/2, @@ -179,6 +180,20 @@ command(Cmd) -> %% =========================================================================== %% +%% gethostname - Get the name of the current host. +%% +%% + +-spec gethostname() -> {ok, HostName} | {error, Reason} when + HostName :: string(), + Reason :: term(). + +gethostname() -> + nif_gethostname(). + + +%% =========================================================================== +%% %% getnameinfo - Address-to-name translation in protocol-independent manner. %% %% @@ -324,6 +339,9 @@ nif_info() -> nif_command(_Cmd) -> erlang:error(badarg). +nif_gethostname() -> + erlang:error(badarg). + nif_getnameinfo(_Addr, _Flags) -> erlang:error(badarg). |