diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -25,7 +25,7 @@ extern crate nix_test as nixtest; pub extern crate libc; -pub use errno::Errno; +use errno::Errno; pub mod errno; pub mod features; @@ -43,6 +43,15 @@ pub mod poll; pub mod net; +#[cfg(any(target_os = "dragonfly", + target_os = "freebsd", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd"))] +pub mod ifaddrs; + #[cfg(any(target_os = "linux", target_os = "android"))] pub mod sched; @@ -96,24 +105,24 @@ pub enum Error { impl Error { /// Create a nix Error from a given errno - pub fn from_errno(errno: errno::Errno) -> Error { + pub fn from_errno(errno: Errno) -> Error { Error::Sys(errno) } /// Get the current errno and convert it to a nix Error pub fn last() -> Error { - Error::Sys(errno::Errno::last()) + Error::Sys(Errno::last()) } /// Create a new invalid argument error (`EINVAL`) pub fn invalid_argument() -> Error { - Error::Sys(errno::EINVAL) + Error::Sys(Errno::EINVAL) } } -impl From<errno::Errno> for Error { - fn from(errno: errno::Errno) -> Error { Error::from_errno(errno) } +impl From<Errno> for Error { + fn from(errno: Errno) -> Error { Error::from_errno(errno) } } impl From<std::string::FromUtf8Error> for Error { |