Lines Matching refs:SystemError

16     syscall::{Syscall, SystemError},
34 ) -> Result<usize, SystemError> { in socket() argument
49 return Err(SystemError::EINVAL); in socket()
54 return Err(SystemError::EAFNOSUPPORT); in socket()
79 ) -> Result<usize, SystemError> { in setsockopt() argument
82 .ok_or(SystemError::EBADF)?; in setsockopt()
103 ) -> Result<usize, SystemError> { in getsockopt() argument
108 .ok_or(SystemError::EBADF)?; in getsockopt()
113 .map_err(|_| SystemError::ENOPROTOOPT)?; in getsockopt()
133 return Err(SystemError::ENOPROTOOPT); in getsockopt()
146 PosixIpProtocol::try_from(level as u16).map_err(|_| SystemError::ENOPROTOOPT)?; in getsockopt()
149 .map_err(|_| SystemError::ENOPROTOOPT)?; in getsockopt()
153 return Err(SystemError::ENOPROTOOPT); in getsockopt()
157 return Err(SystemError::ENOPROTOOPT); in getsockopt()
167 pub fn connect(fd: usize, addr: *const SockAddr, addrlen: usize) -> Result<usize, SystemError> { in connect() argument
171 .ok_or(SystemError::EBADF)?; in connect()
185 pub fn bind(fd: usize, addr: *const SockAddr, addrlen: usize) -> Result<usize, SystemError> { in bind() argument
189 .ok_or(SystemError::EBADF)?; in bind()
210 ) -> Result<usize, SystemError> { in sendto() argument
219 .ok_or(SystemError::EBADF)?; in sendto()
239 ) -> Result<usize, SystemError> { in recvfrom() argument
242 .ok_or(SystemError::EBADF)?; in recvfrom()
267 pub fn recvmsg(fd: usize, msg: &mut MsgHdr, _flags: u32) -> Result<usize, SystemError> { in recvmsg() argument
273 .ok_or(SystemError::EBADF)?; in recvmsg()
299 pub fn listen(fd: usize, backlog: usize) -> Result<usize, SystemError> { in listen() argument
302 .ok_or(SystemError::EBADF)?; in listen()
314 pub fn shutdown(fd: usize, how: usize) -> Result<usize, SystemError> { in shutdown() argument
317 .ok_or(SystemError::EBADF)?; in shutdown()
330 pub fn accept(fd: usize, addr: *mut SockAddr, addrlen: *mut u32) -> Result<usize, SystemError> { in accept() argument
333 .ok_or(SystemError::EBADF)?; in accept()
370 ) -> Result<usize, SystemError> { in getsockname() argument
372 return Err(SystemError::EINVAL); in getsockname()
376 .ok_or(SystemError::EBADF)?; in getsockname()
378 let endpoint: Endpoint = socket.endpoint().ok_or(SystemError::EINVAL)?; in getsockname()
399 ) -> Result<usize, SystemError> { in getpeername() argument
401 return Err(SystemError::EINVAL); in getpeername()
406 .ok_or(SystemError::EBADF)?; in getpeername()
408 let endpoint: Endpoint = socket.peer_endpoint().ok_or(SystemError::EINVAL)?; in getpeername()
477 pub fn to_endpoint(addr: *const SockAddr, len: usize) -> Result<Endpoint, SystemError> { in to_endpoint() argument
485 return Err(SystemError::EFAULT); in to_endpoint()
488 let addr = unsafe { addr.as_ref() }.ok_or(SystemError::EFAULT)?; in to_endpoint()
490 return Err(SystemError::EINVAL); in to_endpoint()
506 return Err(SystemError::EINVAL); in to_endpoint()
510 return Err(SystemError::EINVAL); in to_endpoint()
513 return Err(SystemError::EINVAL); in to_endpoint()
516 return Err(SystemError::EINVAL); in to_endpoint()
523 pub fn len(&self) -> Result<usize, SystemError> { in len() argument
528 AddressFamily::Unix => Err(SystemError::EINVAL), in len()
529 _ => Err(SystemError::EINVAL), in len()
545 ) -> Result<usize, SystemError> { in write_to_user() argument
556 return Err(SystemError::EFAULT); in write_to_user()
702 type Error = SystemError;
707 None => Err(SystemError::EPROTONOSUPPORT), in try_from()
823 type Error = SystemError;
828 None => Err(SystemError::EINVAL), in try_from()
912 type Error = SystemError;
917 None => Err(SystemError::EINVAL), in try_from()