diff options
author | Lukas Larsson <[email protected]> | 2011-12-02 15:08:47 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2011-12-02 15:08:47 +0100 |
commit | f30ac8e5a84c550734b79a6d66639c4d3489c6fd (patch) | |
tree | 331a81551b21d75c41b5edc25b9077bfe2a8cf70 /lib/kernel/src/inet.erl | |
parent | 7bd9c1f9a68a024958040fe5b77dacc73bb6c5ab (diff) | |
parent | 62fffa75e2003b3f19eb7614307942028a400fd1 (diff) | |
download | otp-f30ac8e5a84c550734b79a6d66639c4d3489c6fd.tar.gz otp-f30ac8e5a84c550734b79a6d66639c4d3489c6fd.tar.bz2 otp-f30ac8e5a84c550734b79a6d66639c4d3489c6fd.zip |
Merge branch 'ta/sendfile/OTP-9240'
* ta/sendfile/OTP-9240: (31 commits)
Add sendfile server printouts
Skip recv/send during tests for fallback platforms
Remove header/trailer support
Remove windows implementation
Expand sendfile documentation
Only allow tcp sockets as target for sendfile
Move sendfile api to file module
Preliminary work on header/trailer
Use free_sendfile explicitly for non-async
Remove debug printouts
Add tests for send/recv/sendfile interactions
Remove tests for file_server sendfile
sendfile caller now has to be the controlling_process
Remove support for file_server, sendfile has to be raw
Set chunk size to 3 GB
Change type of fd to be ErlDrvEvent
Add ifdef's for HAVE_SENDFILE
Fix freebsd support for sendfile
Change nbytes to 64 bit
Implement ignorefd for TCP
...
Diffstat (limited to 'lib/kernel/src/inet.erl')
-rw-r--r-- | lib/kernel/src/inet.erl | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/kernel/src/inet.erl b/lib/kernel/src/inet.erl index b60c68e3a1..49f64a9236 100644 --- a/lib/kernel/src/inet.erl +++ b/lib/kernel/src/inet.erl @@ -40,6 +40,10 @@ -export([tcp_controlling_process/2, udp_controlling_process/2, tcp_close/1, udp_close/1]). + +%% used by sendfile +-export([lock_socket/2]). + %% used by socks5 -export([setsockname/2, setpeername/2]). @@ -1353,3 +1357,14 @@ stop_timer(Timer) -> end; T -> T end. + + +lock_socket(S,Val) -> + case erlang:port_info(S, connected) of + {connected, Pid} when Pid =/= self() -> + {error, not_owner}; + undefined -> + {error, einval}; + _ -> + prim_inet:ignorefd(S,Val) + end. |