diff options
author | Raimo Niskanen <[email protected]> | 2010-11-12 10:14:18 +0100 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2010-11-12 10:14:18 +0100 |
commit | 7edc140cb952137672e82f7dc8d7f100660d86f5 (patch) | |
tree | 51c603e06919ada93997015d9d3c05ab3e264a7d /lib/kernel/src/inet.erl | |
parent | ffbde437305a5fe7bd48786d935ed01c1c42a0fa (diff) | |
parent | d5c04534c1a04701493c28ff24d7040cc513515c (diff) | |
download | otp-7edc140cb952137672e82f7dc8d7f100660d86f5.tar.gz otp-7edc140cb952137672e82f7dc8d7f100660d86f5.tar.bz2 otp-7edc140cb952137672e82f7dc8d7f100660d86f5.zip |
Merge branch 'raimo/inet-getifaddrs/OTP-8926' into dev
* raimo/inet-getifaddrs/OTP-8926:
Write documentation
Delete decommented code
Add testcase
Implement inet:getifaddrs/0 on Windows
Implement basic inet:getifaddrs/0
Fix building error of SCTP in FreeBSD 7.1 and later
Diffstat (limited to 'lib/kernel/src/inet.erl')
-rw-r--r-- | lib/kernel/src/inet.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/kernel/src/inet.erl b/lib/kernel/src/inet.erl index 93d75321ba..327e0f93f1 100644 --- a/lib/kernel/src/inet.erl +++ b/lib/kernel/src/inet.erl @@ -25,6 +25,7 @@ %% socket -export([peername/1, sockname/1, port/1, send/2, setopts/2, getopts/2, + getifaddrs/0, getifaddrs/1, getif/1, getif/0, getiflist/0, getiflist/1, ifget/3, ifget/2, ifset/3, ifset/2, getstat/1, getstat/2, @@ -265,6 +266,17 @@ setopts(Socket, Opts) -> getopts(Socket, Opts) -> prim_inet:getopts(Socket, Opts). +-spec getifaddrs(Socket :: socket()) -> + {'ok', [string()]} | {'error', posix()}. + +getifaddrs(Socket) -> + prim_inet:getifaddrs(Socket). + +-spec getifaddrs() -> {'ok', [string()]} | {'error', posix()}. + +getifaddrs() -> + withsocket(fun(S) -> prim_inet:getifaddrs(S) end). + -spec getiflist(Socket :: socket()) -> {'ok', [string()]} | {'error', posix()}. |