• Home
  • Raw
  • Download

Lines Matching full:libc

13 use libc::SO_KEEPALIVE as KEEPALIVE_TIME;
15 use libc::TCP_KEEPALIVE as KEEPALIVE_TIME;
23 use libc::TCP_KEEPIDLE as KEEPALIVE_TIME;
24 pub type TcpSocket = libc::c_int;
27 new_socket(libc::AF_INET, libc::SOCK_STREAM) in new_v4_socket()
31 new_socket(libc::AF_INET6, libc::SOCK_STREAM) in new_v6_socket()
44 Err(err) if err.raw_os_error() != Some(libc::EINPROGRESS) => { in connect()
64 let val: libc::c_int = if reuseaddr { 1 } else { 0 }; in set_reuseaddr()
67 libc::SOL_SOCKET, in set_reuseaddr()
68 libc::SO_REUSEADDR, in set_reuseaddr()
69 &val as *const libc::c_int as *const libc::c_void, in set_reuseaddr()
70 size_of::<libc::c_int>() as libc::socklen_t, in set_reuseaddr()
76 let mut optval: libc::c_int = 0; in get_reuseaddr()
77 let mut optlen = mem::size_of::<libc::c_int>() as libc::socklen_t; in get_reuseaddr()
81 libc::SOL_SOCKET, in get_reuseaddr()
82 libc::SO_REUSEADDR, in get_reuseaddr()
92 let val: libc::c_int = if reuseport { 1 } else { 0 }; in set_reuseport()
96 libc::SOL_SOCKET, in set_reuseport()
97 libc::SO_REUSEPORT, in set_reuseport()
98 &val as *const libc::c_int as *const libc::c_void, in set_reuseport()
99 size_of::<libc::c_int>() as libc::socklen_t, in set_reuseport()
106 let mut optval: libc::c_int = 0; in get_reuseport()
107 let mut optlen = mem::size_of::<libc::c_int>() as libc::socklen_t; in get_reuseport()
111 libc::SOL_SOCKET, in get_reuseport()
112 libc::SO_REUSEPORT, in get_reuseport()
121 let mut addr: libc::sockaddr_storage = unsafe { std::mem::zeroed() }; in get_localaddr()
122 let mut length = size_of::<libc::sockaddr_storage>() as libc::socklen_t; in get_localaddr()
134 let val: libc::linger = libc::linger { in set_linger()
137 .map(|dur| dur.as_secs() as libc::c_int) in set_linger()
142 libc::SOL_SOCKET, in set_linger()
144 libc::SO_LINGER_SEC, in set_linger()
146 libc::SO_LINGER, in set_linger()
147 &val as *const libc::linger as *const libc::c_void, in set_linger()
148 size_of::<libc::linger>() as libc::socklen_t, in set_linger()
154 let mut val: libc::linger = unsafe { std::mem::zeroed() }; in get_linger()
155 let mut len = mem::size_of::<libc::linger>() as libc::socklen_t; in get_linger()
159 libc::SOL_SOCKET, in get_linger()
161 libc::SO_LINGER_SEC, in get_linger()
163 libc::SO_LINGER, in get_linger()
179 libc::SOL_SOCKET, in set_recv_buffer_size()
180 libc::SO_RCVBUF, in set_recv_buffer_size()
181 &size as *const _ as *const libc::c_void, in set_recv_buffer_size()
182 size_of::<libc::c_int>() as libc::socklen_t in set_recv_buffer_size()
188 let mut optval: libc::c_int = 0; in get_recv_buffer_size()
189 let mut optlen = size_of::<libc::c_int>() as libc::socklen_t; in get_recv_buffer_size()
192 libc::SOL_SOCKET, in get_recv_buffer_size()
193 libc::SO_RCVBUF, in get_recv_buffer_size()
205 libc::SOL_SOCKET, in set_send_buffer_size()
206 libc::SO_SNDBUF, in set_send_buffer_size()
207 &size as *const _ as *const libc::c_void, in set_send_buffer_size()
208 size_of::<libc::c_int>() as libc::socklen_t in set_send_buffer_size()
214 let mut optval: libc::c_int = 0; in get_send_buffer_size()
215 let mut optlen = size_of::<libc::c_int>() as libc::socklen_t; in get_send_buffer_size()
219 libc::SOL_SOCKET, in get_send_buffer_size()
220 libc::SO_SNDBUF, in get_send_buffer_size()
229 let val: libc::c_int = if keepalive { 1 } else { 0 }; in set_keepalive()
232 libc::SOL_SOCKET, in set_keepalive()
233 libc::SO_KEEPALIVE, in set_keepalive()
234 &val as *const _ as *const libc::c_void, in set_keepalive()
235 size_of::<libc::c_int>() as libc::socklen_t in set_keepalive()
241 let mut optval: libc::c_int = 0; in get_keepalive()
242 let mut optlen = mem::size_of::<libc::c_int>() as libc::socklen_t; in get_keepalive()
246 libc::SOL_SOCKET, in get_keepalive()
247 libc::SO_KEEPALIVE, in get_keepalive()
289 libc::IPPROTO_TCP, in set_keepalive_time()
291 &(time_secs as libc::c_int) as *const _ as *const libc::c_void, in set_keepalive_time()
292 size_of::<libc::c_int>() as libc::socklen_t in set_keepalive_time()
302 let mut optval: libc::c_int = 0; in get_keepalive_time()
303 let mut optlen = mem::size_of::<libc::c_int>() as libc::socklen_t; in get_keepalive_time()
306 libc::IPPROTO_TCP, in get_keepalive_time()
339 libc::IPPROTO_TCP, in set_keepalive_interval()
340 libc::TCP_KEEPINTVL, in set_keepalive_interval()
341 &(interval_secs as libc::c_int) as *const _ as *const libc::c_void, in set_keepalive_interval()
342 size_of::<libc::c_int>() as libc::socklen_t in set_keepalive_interval()
359 let mut optval: libc::c_int = 0; in get_keepalive_interval()
360 let mut optlen = mem::size_of::<libc::c_int>() as libc::socklen_t; in get_keepalive_interval()
363 libc::IPPROTO_TCP, in get_keepalive_interval()
364 libc::TCP_KEEPINTVL, in get_keepalive_interval()
392 libc::IPPROTO_TCP, in set_keepalive_retries()
393 libc::TCP_KEEPCNT, in set_keepalive_retries()
394 &(retries as libc::c_int) as *const _ as *const libc::c_void, in set_keepalive_retries()
395 size_of::<libc::c_int>() as libc::socklen_t in set_keepalive_retries()
412 let mut optval: libc::c_int = 0; in get_keepalive_retries()
413 let mut optlen = mem::size_of::<libc::c_int>() as libc::socklen_t; in get_keepalive_retries()
416 libc::IPPROTO_TCP, in get_keepalive_retries()
417 libc::TCP_KEEPCNT, in get_keepalive_retries()
426 let mut addr: MaybeUninit<libc::sockaddr_storage> = MaybeUninit::uninit(); in accept()
427 let mut length = size_of::<libc::sockaddr_storage>() as libc::socklen_t; in accept()
450 libc::SOCK_CLOEXEC | libc::SOCK_NONBLOCK, in accept()
475 syscall!(fcntl(s.as_raw_fd(), libc::F_SETFD, libc::FD_CLOEXEC))?; in accept()
479 syscall!(fcntl(s.as_raw_fd(), libc::F_SETFL, libc::O_NONBLOCK))?; in accept()