diff options
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). |