diff options
author | Micael Karlberg <[email protected]> | 2018-09-13 15:44:21 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2018-09-18 14:50:18 +0200 |
commit | 929ae46220f402d6f36072c46fe27ba39ad48d1b (patch) | |
tree | b51ba588683a452a13603294f3e2990526b30538 /erts/preloaded/src/net.erl | |
parent | ee2eadd1c61d4237ee4044260665c82edf559228 (diff) | |
download | otp-929ae46220f402d6f36072c46fe27ba39ad48d1b.tar.gz otp-929ae46220f402d6f36072c46fe27ba39ad48d1b.tar.bz2 otp-929ae46220f402d6f36072c46fe27ba39ad48d1b.zip |
[socket-nif] CMsgHdr and various doc related changes
Updated the (send) cmsghdr type and the handling of it
(in the nif code). Still not tested!
Removed the is_loaded nif function.
Tried to get fix the doc build problem (socket.erl *i think*),
which causes socket.html generation to fail with:
"cannot find module exporting type"
To solve this I tried to run dialyzer on preloaded, and ran into
problems with enc_setopt_value. Update various specs and types
to "solve" this (which did not work).
Updated the nif-stub functions to make dialyzer happy.
Diffstat (limited to 'erts/preloaded/src/net.erl')
-rw-r--r-- | erts/preloaded/src/net.erl | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/erts/preloaded/src/net.erl b/erts/preloaded/src/net.erl index 01b12696e9..0183a69ddb 100644 --- a/erts/preloaded/src/net.erl +++ b/erts/preloaded/src/net.erl @@ -20,9 +20,11 @@ -module(net). +-compile(no_native). + %% Administrative and "global" utility functions -export([ - on_load/0, on_load/1, on_load/2, + on_load/0, on_load/1, info/0, command/1 ]). @@ -105,23 +107,10 @@ on_load() -> on_load(#{}). -spec on_load(Extra) -> ok when - Extra :: maps:map(). - -on_load(Extra) when is_map(Extra) -> - on_load(atom_to_list(?MODULE), Extra). - --spec on_load(Path, Extra) -> ok when - Path :: string(), - Extra :: maps:map(). - -on_load(Path, Extra) when is_list(Path) andalso is_map(Extra) -> - on_load(nif_is_loaded(), Path, Extra). - -on_load(true, _Path, _Extra) -> - ok; -on_load(false, Path, Extra) -> - ok = erlang:load_nif(Path, Extra). + Extra :: map(). +on_load(Extra) -> + ok = erlang:load_nif(atom_to_list(?MODULE), Extra). -spec info() -> list(). @@ -315,29 +304,26 @@ if_names() -> %% %% =========================================================================== -nif_is_loaded() -> - false. - nif_info() -> - erlang:error(badarg). + erlang:nif_error(undef). nif_command(_Cmd) -> - erlang:error(badarg). + erlang:nif_error(undef). nif_gethostname() -> - erlang:error(badarg). + erlang:nif_error(undef). nif_getnameinfo(_Addr, _Flags) -> - erlang:error(badarg). + erlang:nif_error(undef). nif_getaddrinfo(_Host, _Service, _Hints) -> - erlang:error(badarg). + erlang:nif_error(undef). nif_if_name2index(_Name) -> - erlang:error(badarg). + erlang:nif_error(undef). nif_if_index2name(_Id) -> - erlang:error(badarg). + erlang:nif_error(undef). nif_if_names() -> - erlang:error(badarg). + erlang:nif_error(undef). |