From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- vendor/hermit-abi/src/tcpstream.rs | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'vendor/hermit-abi/src/tcpstream.rs') diff --git a/vendor/hermit-abi/src/tcpstream.rs b/vendor/hermit-abi/src/tcpstream.rs index 3024d379f..c8fcd1891 100644 --- a/vendor/hermit-abi/src/tcpstream.rs +++ b/vendor/hermit-abi/src/tcpstream.rs @@ -20,57 +20,58 @@ extern "Rust" { } /// Opens a TCP connection to a remote host. -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn connect(ip: &[u8], port: u16, timeout: Option) -> Result { unsafe { sys_tcp_stream_connect(ip, port, timeout) } } /// Close a TCP connection -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn close(handle: Handle) -> Result<(), ()> { unsafe { sys_tcp_stream_close(handle) } } -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn peek(handle: Handle, buf: &mut [u8]) -> Result { unsafe { sys_tcp_stream_peek(handle, buf) } } -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn peer_addr(handle: Handle) -> Result<(IpAddress, u16), ()> { unsafe { sys_tcp_stream_peer_addr(handle) } } -#[inline(always)] + +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn read(handle: Handle, buffer: &mut [u8]) -> Result { unsafe { sys_tcp_stream_read(handle, buffer) } } -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn write(handle: Handle, buffer: &[u8]) -> Result { unsafe { sys_tcp_stream_write(handle, buffer) } } -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn set_read_timeout(handle: Handle, timeout: Option) -> Result<(), ()> { unsafe { sys_tcp_stream_set_read_timeout(handle, timeout) } } -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn set_write_timeout(handle: Handle, timeout: Option) -> Result<(), ()> { unsafe { sys_tcp_stream_set_write_timeout(handle, timeout) } } -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn get_read_timeout(handle: Handle) -> Result, ()> { unsafe { sys_tcp_stream_get_read_timeout(handle) } } -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn get_write_timeout(handle: Handle) -> Result, ()> { unsafe { sys_tcp_stream_get_write_timeout(handle) } } -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn set_nodelay(_: Handle, mode: bool) -> Result<(), ()> { // smoltcp does not support Nagle's algorithm // => to enable Nagle's algorithm isn't possible @@ -81,29 +82,29 @@ pub fn set_nodelay(_: Handle, mode: bool) -> Result<(), ()> { } } -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn nodelay(_: Handle) -> Result { // smoltcp does not support Nagle's algorithm // => return always true Ok(true) } -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn set_nonblocking(handle: Handle, mode: bool) -> Result<(), ()> { unsafe { sys_tcp_stream_set_nonblocking(handle, mode) } } -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn set_tll(handle: Handle, ttl: u32) -> Result<(), ()> { unsafe { sys_tcp_stream_set_tll(handle, ttl) } } -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn get_tll(handle: Handle) -> Result { unsafe { sys_tcp_stream_get_tll(handle) } } -#[inline(always)] +#[deprecated(since = "0.3.0", note = "please use new BSD socket interface")] pub fn shutdown(handle: Handle, how: i32) -> Result<(), ()> { unsafe { sys_tcp_stream_shutdown(handle, how) } } -- cgit v1.2.3