diff --git a/examples/process.rs b/examples/process.rs index 77f8601f3..e8d5397fe 100644 --- a/examples/process.rs +++ b/examples/process.rs @@ -42,9 +42,13 @@ fn main() -> io::Result<()> { println!("Data Limit: {:?}", getrlimit(Resource::Data)); println!("Stack Limit: {:?}", getrlimit(Resource::Stack)); println!("Core Limit: {:?}", getrlimit(Resource::Core)); + #[cfg(not(target_os = "solaris"))] println!("Rss Limit: {:?}", getrlimit(Resource::Rss)); + #[cfg(not(target_os = "solaris"))] println!("Nproc Limit: {:?}", getrlimit(Resource::Nproc)); + #[cfg(not(target_os = "solaris"))] println!("Nofile Limit: {:?}", getrlimit(Resource::Nofile)); + #[cfg(not(target_os = "solaris"))] println!("Memlock Limit: {:?}", getrlimit(Resource::Memlock)); #[cfg(not(target_os = "openbsd"))] println!("As Limit: {:?}", getrlimit(Resource::As)); @@ -54,6 +58,7 @@ fn main() -> io::Result<()> { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] println!("Locks Limit: {:?}", getrlimit(Resource::Locks)); #[cfg(not(any( @@ -62,6 +67,7 @@ fn main() -> io::Result<()> { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] println!("Sigpending Limit: {:?}", getrlimit(Resource::Sigpending)); #[cfg(not(any( @@ -70,6 +76,7 @@ fn main() -> io::Result<()> { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] println!("Msgqueue Limit: {:?}", getrlimit(Resource::Msgqueue)); #[cfg(not(any( @@ -78,6 +85,7 @@ fn main() -> io::Result<()> { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] println!("Nice Limit: {:?}", getrlimit(Resource::Nice)); #[cfg(not(any( @@ -86,6 +94,7 @@ fn main() -> io::Result<()> { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] println!("Rtprio Limit: {:?}", getrlimit(Resource::Rtprio)); #[cfg(not(any( @@ -96,6 +105,7 @@ fn main() -> io::Result<()> { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] println!("Rttime Limit: {:?}", getrlimit(Resource::Rttime)); #[cfg(any( diff --git a/examples/stdio.rs b/examples/stdio.rs index 9e79d5356..a435210d8 100644 --- a/examples/stdio.rs +++ b/examples/stdio.rs @@ -124,6 +124,7 @@ fn show(fd: Fd) -> io::Result<()> { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] if (term.c_iflag & IUTF8) != 0 { print!(" IUTF8"); @@ -193,6 +194,7 @@ fn show(fd: Fd) -> io::Result<()> { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] if (term.c_oflag & NLDLY) != 0 { print!(" NLDLY"); @@ -206,6 +208,7 @@ fn show(fd: Fd) -> io::Result<()> { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] if (term.c_oflag & CRDLY) != 0 { print!(" CRDLY"); @@ -217,6 +220,7 @@ fn show(fd: Fd) -> io::Result<()> { target_os = "openbsd", target_os = "illumos", target_os = "redox", + target_os = "solaris", )))] if (term.c_oflag & TABDLY) != 0 { print!(" TABDLY"); @@ -230,6 +234,7 @@ fn show(fd: Fd) -> io::Result<()> { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] if (term.c_oflag & BSDLY) != 0 { print!(" BSDLY"); @@ -244,6 +249,7 @@ fn show(fd: Fd) -> io::Result<()> { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] if (term.c_oflag & VTDLY) != 0 { print!(" VTDLY"); @@ -258,6 +264,7 @@ fn show(fd: Fd) -> io::Result<()> { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] if (term.c_oflag & FFDLY) != 0 { print!(" FFDLY"); @@ -286,6 +293,7 @@ fn show(fd: Fd) -> io::Result<()> { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] if (term.c_cflag & CBAUDEX) != 0 { print!(" CBAUDEX"); @@ -339,6 +347,7 @@ fn show(fd: Fd) -> io::Result<()> { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] if (term.c_cflag & CMSPAR) != 0 { print!(" CMSPAR"); diff --git a/src/backend/libc/fs/dir.rs b/src/backend/libc/fs/dir.rs index 616f5c02e..95e6292a5 100644 --- a/src/backend/libc/fs/dir.rs +++ b/src/backend/libc/fs/dir.rs @@ -1,6 +1,6 @@ use super::super::c; use super::super::conv::owned_fd; -#[cfg(not(target_os = "illumos"))] +#[cfg(not(any(target_os = "illumos", target_os = "solaris")))] use super::types::FileType; use crate::fd::{AsFd, BorrowedFd}; use crate::ffi::CStr; @@ -11,10 +11,16 @@ use crate::fs::{fcntl_getfl, fstat, openat, Mode, OFlags, Stat}; target_os = "illumos", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] use crate::fs::{fstatfs, StatFs}; -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] use crate::fs::{fstatvfs, StatVfs}; use crate::io; #[cfg(not(any(target_os = "fuchsia", target_os = "wasi")))] @@ -134,6 +140,7 @@ impl Dir { target_os = "illumos", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] #[inline] @@ -142,7 +149,12 @@ impl Dir { } /// `fstatvfs(self)` - #[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] + #[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", + )))] #[inline] pub fn statvfs(&self) -> io::Result { fstatvfs(unsafe { BorrowedFd::borrow_raw(c::dirfd(self.0.as_ptr())) }) @@ -160,7 +172,7 @@ impl Dir { // struct, as the name is NUL-terminated and memory may not be allocated for // the full extent of the struct. Copy the fields one at a time. unsafe fn read_dirent(input: &libc_dirent) -> libc_dirent { - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] let d_type = input.d_type; #[cfg(not(any( @@ -204,7 +216,7 @@ unsafe fn read_dirent(input: &libc_dirent) -> libc_dirent { // whole `d_name` field, which may not be entirely allocated. #[cfg_attr(target_os = "wasi", allow(unused_mut))] let mut dirent = libc_dirent { - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] d_type, #[cfg(not(any( target_os = "dragonfly", @@ -315,7 +327,7 @@ impl DirEntry { } /// Returns the type of this directory entry. - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] #[inline] pub fn file_type(&self) -> FileType { FileType::from_dirent_d_type(self.dirent.d_type) diff --git a/src/backend/libc/fs/mod.rs b/src/backend/libc/fs/mod.rs index 02b7b2d6a..b0a5ab6f2 100644 --- a/src/backend/libc/fs/mod.rs +++ b/src/backend/libc/fs/mod.rs @@ -10,6 +10,7 @@ pub(crate) mod dir; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] pub(crate) mod makedev; diff --git a/src/backend/libc/fs/syscalls.rs b/src/backend/libc/fs/syscalls.rs index 3db6628f1..db75431ff 100644 --- a/src/backend/libc/fs/syscalls.rs +++ b/src/backend/libc/fs/syscalls.rs @@ -16,6 +16,7 @@ use super::super::offset::libc_fallocate; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] use super::super::offset::libc_posix_fadvise; #[cfg(not(any( @@ -29,6 +30,7 @@ use super::super::offset::libc_posix_fadvise; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] use super::super::offset::libc_posix_fallocate; use super::super::offset::{libc_fstat, libc_fstatat, libc_ftruncate, libc_lseek, libc_off_t}; @@ -36,10 +38,16 @@ use super::super::offset::{libc_fstat, libc_fstatat, libc_ftruncate, libc_lseek, target_os = "illumos", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] use super::super::offset::{libc_fstatfs, libc_statfs}; -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] use super::super::offset::{libc_fstatvfs, libc_statvfs}; #[cfg(all( any(target_arch = "arm", target_arch = "mips", target_arch = "x86"), @@ -52,7 +60,7 @@ use crate::fd::{BorrowedFd, OwnedFd}; use crate::ffi::CStr; #[cfg(any(target_os = "ios", target_os = "macos"))] use crate::ffi::CString; -#[cfg(not(target_os = "illumos"))] +#[cfg(not(any(target_os = "illumos", target_os = "solaris")))] use crate::fs::Access; #[cfg(not(any( target_os = "dragonfly", @@ -62,6 +70,7 @@ use crate::fs::Access; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] use crate::fs::Advice; #[cfg(not(any( @@ -70,9 +79,10 @@ use crate::fs::Advice; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] use crate::fs::FallocateFlags; -#[cfg(not(target_os = "wasi"))] +#[cfg(not(any(target_os = "solaris", target_os = "wasi")))] use crate::fs::FlockOperation; #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] use crate::fs::MemfdFlags; @@ -87,6 +97,7 @@ use crate::fs::SealFlags; target_os = "illumos", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] use crate::fs::StatFs; @@ -100,7 +111,12 @@ use crate::fs::{cwd, RenameFlags, ResolveFlags, Statx, StatxFlags}; )))] use crate::fs::{Dev, FileType}; use crate::fs::{FdFlags, Mode, OFlags, Stat, Timestamps}; -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] use crate::fs::{StatVfs, StatVfsMountFlags}; use crate::io::{self, SeekFrom}; #[cfg(not(target_os = "wasi"))] @@ -202,6 +218,7 @@ pub(crate) fn openat( target_os = "illumos", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] #[inline] @@ -213,7 +230,12 @@ pub(crate) fn statfs(filename: &CStr) -> io::Result { } } -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] #[inline] pub(crate) fn statvfs(filename: &CStr) -> io::Result { unsafe { @@ -403,7 +425,12 @@ fn statat_old(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::Result< } } -#[cfg(not(any(target_os = "emscripten", target_os = "illumos", target_os = "redox")))] +#[cfg(not(any( + target_os = "emscripten", + target_os = "illumos", + target_os = "redox", + target_os = "solaris", +)))] pub(crate) fn accessat( dirfd: BorrowedFd<'_>, path: &CStr, @@ -776,6 +803,7 @@ pub(crate) fn copy_file_range( target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub(crate) fn fadvise(fd: BorrowedFd<'_>, offset: u64, len: u64, advice: Advice) -> io::Result<()> { let offset = offset as i64; @@ -848,7 +876,7 @@ pub(crate) fn fcntl_add_seals(fd: BorrowedFd<'_>, seals: SealFlags) -> io::Resul #[cfg(not(target_os = "wasi"))] pub(crate) fn fcntl_dupfd_cloexec(fd: BorrowedFd<'_>, min: RawFd) -> io::Result { - unsafe { ret_owned_fd(c::fcntl(borrowed_fd(fd), c::F_DUPFD_CLOEXEC, min)) } + unsafe { ret_owned_fd(c::fcntl(borrowed_fd(fd), 47, min)) } } pub(crate) fn seek(fd: BorrowedFd<'_>, pos: SeekFrom) -> io::Result { @@ -910,7 +938,7 @@ pub(crate) fn fchown(fd: BorrowedFd<'_>, owner: Option, group: Option) } } -#[cfg(not(target_os = "wasi"))] +#[cfg(not(any(target_os = "solaris", target_os = "wasi")))] pub(crate) fn flock(fd: BorrowedFd<'_>, operation: FlockOperation) -> io::Result<()> { unsafe { ret(c::flock(borrowed_fd(fd), operation as c::c_int)) } } @@ -959,6 +987,7 @@ fn fstat_old(fd: BorrowedFd<'_>) -> io::Result { target_os = "illumos", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] pub(crate) fn fstatfs(fd: BorrowedFd<'_>) -> io::Result { @@ -969,7 +998,12 @@ pub(crate) fn fstatfs(fd: BorrowedFd<'_>) -> io::Result { } } -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] pub(crate) fn fstatvfs(fd: BorrowedFd<'_>) -> io::Result { let mut statvfs = MaybeUninit::::uninit(); unsafe { @@ -978,7 +1012,12 @@ pub(crate) fn fstatvfs(fd: BorrowedFd<'_>) -> io::Result { } } -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi" +)))] fn libc_statvfs_to_statvfs(from: libc_statvfs) -> StatVfs { StatVfs { f_bsize: from.f_bsize as u64, @@ -1104,6 +1143,7 @@ unsafe fn futimens_old(fd: BorrowedFd<'_>, times: &Timestamps) -> io::Result<()> target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub(crate) fn fallocate( fd: BorrowedFd<'_>, diff --git a/src/backend/libc/fs/types.rs b/src/backend/libc/fs/types.rs index 829100410..1769f7282 100644 --- a/src/backend/libc/fs/types.rs +++ b/src/backend/libc/fs/types.rs @@ -438,7 +438,7 @@ impl FileType { } /// Construct a `FileType` from the `d_type` field of a `c::dirent`. - #[cfg(not(any(target_os = "illumos", target_os = "redox")))] + #[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "solaris")))] pub(crate) const fn from_dirent_d_type(d_type: u8) -> Self { match d_type { c::DT_REG => Self::RegularFile, @@ -467,6 +467,7 @@ impl FileType { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] #[derive(Debug, Copy, Clone, Eq, PartialEq)] #[repr(u32)] @@ -685,6 +686,7 @@ bitflags! { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] bitflags! { /// `FALLOC_FL_*` constants for use with [`fallocate`]. @@ -778,7 +780,12 @@ bitflags! { } } -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi",)))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] bitflags! { /// `ST_*` constants for use with [`StatVfs`]. pub struct StatVfsMountFlags: u64 { @@ -821,7 +828,7 @@ bitflags! { /// `LOCK_*` constants for use with [`flock`] /// /// [`flock`]: crate::fs::flock -#[cfg(not(target_os = "wasi"))] +#[cfg(not(any(target_os = "solaris", target_os = "wasi")))] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(i32)] pub enum FlockOperation { @@ -910,6 +917,7 @@ pub struct Stat { target_os = "l4re", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] #[allow(clippy::module_name_repetitions)] @@ -931,7 +939,12 @@ pub type StatFs = c::statfs64; /// /// [`statvfs`]: crate::fs::statvfs /// [`fstatvfs`]: crate::fs::fstatvfs -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi",)))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] #[allow(missing_docs)] pub struct StatVfs { pub f_bsize: u64, diff --git a/src/backend/libc/io/errno.rs b/src/backend/libc/io/errno.rs index 470cf205c..7a37f5c11 100644 --- a/src/backend/libc/io/errno.rs +++ b/src/backend/libc/io/errno.rs @@ -216,6 +216,7 @@ impl Errno { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", target_os = "wasi", )))] pub const DOTDOT: Self = Self(c::EDOTDOT); @@ -257,6 +258,7 @@ impl Errno { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] pub const HWPOISON: Self = Self(c::EHWPOISON); @@ -301,6 +303,7 @@ impl Errno { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", target_os = "wasi", )))] pub const ISNAM: Self = Self(c::EISNAM); @@ -314,6 +317,7 @@ impl Errno { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", target_os = "wasi", )))] pub const KEYEXPIRED: Self = Self(c::EKEYEXPIRED); @@ -327,6 +331,7 @@ impl Errno { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", target_os = "wasi", )))] pub const KEYREJECTED: Self = Self(c::EKEYREJECTED); @@ -340,6 +345,7 @@ impl Errno { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", target_os = "wasi", )))] pub const KEYREVOKED: Self = Self(c::EKEYREVOKED); @@ -475,6 +481,7 @@ impl Errno { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", target_os = "wasi", )))] pub const MEDIUMTYPE: Self = Self(c::EMEDIUMTYPE); @@ -500,6 +507,7 @@ impl Errno { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", target_os = "wasi", )))] pub const NAVAIL: Self = Self(c::ENAVAIL); @@ -586,6 +594,7 @@ impl Errno { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", target_os = "wasi", )))] pub const NOKEY: Self = Self(c::ENOKEY); @@ -605,6 +614,7 @@ impl Errno { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", target_os = "wasi", )))] pub const NOMEDIUM: Self = Self(c::ENOMEDIUM); @@ -690,6 +700,7 @@ impl Errno { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", target_os = "wasi", )))] pub const NOTNAM: Self = Self(c::ENOTNAM); @@ -817,6 +828,7 @@ impl Errno { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", target_os = "wasi", )))] pub const REMOTEIO: Self = Self(c::EREMOTEIO); @@ -844,6 +856,7 @@ impl Errno { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] pub const RFKILL: Self = Self(c::ERFKILL); @@ -929,6 +942,7 @@ impl Errno { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", target_os = "wasi", )))] pub const UCLEAN: Self = Self(c::EUCLEAN); diff --git a/src/backend/libc/io/syscalls.rs b/src/backend/libc/io/syscalls.rs index 48ac42746..9d1981e99 100644 --- a/src/backend/libc/io/syscalls.rs +++ b/src/backend/libc/io/syscalls.rs @@ -7,7 +7,7 @@ use super::super::conv::{ borrowed_fd, ret, ret_c_int, ret_discarded_fd, ret_owned_fd, ret_ssize_t, }; use super::super::offset::{libc_pread, libc_pwrite}; -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "solaris")))] use super::super::offset::{libc_preadv, libc_pwritev}; #[cfg(all(target_os = "linux", target_env = "gnu"))] use super::super::offset::{libc_preadv2, libc_pwritev2}; @@ -103,7 +103,7 @@ pub(crate) fn writev(fd: BorrowedFd<'_>, bufs: &[IoSlice]) -> io::Result Ok(nwritten as usize) } -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "solaris")))] pub(crate) fn preadv( fd: BorrowedFd<'_>, bufs: &mut [IoSliceMut], @@ -122,7 +122,7 @@ pub(crate) fn preadv( Ok(nread as usize) } -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "solaris")))] pub(crate) fn pwritev(fd: BorrowedFd<'_>, bufs: &[IoSlice], offset: u64) -> io::Result { // Silently cast; we'll get `EINVAL` if the value is negative. let offset = offset as i64; diff --git a/src/backend/libc/io/types.rs b/src/backend/libc/io/types.rs index 483f3a6af..ada610471 100644 --- a/src/backend/libc/io/types.rs +++ b/src/backend/libc/io/types.rs @@ -53,7 +53,12 @@ bitflags! { /// `O_CLOEXEC` const CLOEXEC = c::O_CLOEXEC; /// `O_DIRECT` - #[cfg(not(any(target_os = "illumos", target_os = "openbsd", target_os = "redox")))] + #[cfg(not(any( + target_os = "illumos", + target_os = "openbsd", + target_os = "redox", + target_os = "solaris", + )))] const DIRECT = c::O_DIRECT; /// `O_NONBLOCK` const NONBLOCK = c::O_NONBLOCK; @@ -76,7 +81,12 @@ bitflags! { } /// `PIPE_BUF`—The maximum size of a write to a pipe guaranteed to be atomic. -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] pub const PIPE_BUF: usize = c::PIPE_BUF; #[cfg(not(any(windows, target_os = "redox")))] diff --git a/src/backend/libc/mm/types.rs b/src/backend/libc/mm/types.rs index 385b6c0e6..620298f35 100644 --- a/src/backend/libc/mm/types.rs +++ b/src/backend/libc/mm/types.rs @@ -62,6 +62,7 @@ bitflags! { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] const SHARED_VALIDATE = c::MAP_SHARED_VALIDATE; /// `MAP_PRIVATE` @@ -76,6 +77,7 @@ bitflags! { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] const DENYWRITE = c::MAP_DENYWRITE; /// `MAP_FIXED` @@ -93,6 +95,7 @@ bitflags! { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] const FIXED_NOREPLACE = c::MAP_FIXED_NOREPLACE; /// `MAP_GROWSDOWN` @@ -105,6 +108,7 @@ bitflags! { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] const GROWSDOWN = c::MAP_GROWSDOWN; /// `MAP_HUGETLB` @@ -117,6 +121,7 @@ bitflags! { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] const HUGETLB = c::MAP_HUGETLB; /// `MAP_HUGE_2MB` @@ -132,6 +137,7 @@ bitflags! { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] const HUGE_2MB = c::MAP_HUGE_2MB; /// `MAP_HUGE_1GB` @@ -147,6 +153,7 @@ bitflags! { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] const HUGE_1GB = c::MAP_HUGE_1GB; /// `MAP_LOCKED` @@ -159,6 +166,7 @@ bitflags! { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] const LOCKED = c::MAP_LOCKED; /// `MAP_NORESERVE` @@ -174,6 +182,7 @@ bitflags! { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] const POPULATE = c::MAP_POPULATE; /// `MAP_STACK` @@ -184,6 +193,7 @@ bitflags! { target_os = "macos", target_os = "netbsd", target_os = "redox", + target_os = "solaris", )))] const STACK = c::MAP_STACK; /// `MAP_SYNC` @@ -199,6 +209,7 @@ bitflags! { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", all( any(target_os = "android", target_os = "linux"), any(target_arch = "mips", target_arch = "mips64"), diff --git a/src/backend/libc/net/ext.rs b/src/backend/libc/net/ext.rs index 7b5313c51..804a7544c 100644 --- a/src/backend/libc/net/ext.rs +++ b/src/backend/libc/net/ext.rs @@ -175,7 +175,7 @@ pub(crate) const fn sockaddr_in6_new( sin6_flowinfo, sin6_addr, sin6_scope_id, - #[cfg(target_os = "illumos")] + #[cfg(any(target_os = "illumos", target_os = "solaris"))] __sin6_src_id: 0, } } diff --git a/src/backend/libc/net/send_recv.rs b/src/backend/libc/net/send_recv.rs index 9ab908d62..91ed9be77 100644 --- a/src/backend/libc/net/send_recv.rs +++ b/src/backend/libc/net/send_recv.rs @@ -14,6 +14,7 @@ bitflags! { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] const CONFIRM = c::MSG_CONFIRM; /// `MSG_DONTROUTE` @@ -34,6 +35,7 @@ bitflags! { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] const MORE = c::MSG_MORE; #[cfg(not(any(windows, target_os = "ios", target_os = "macos")))] @@ -47,7 +49,7 @@ bitflags! { bitflags! { /// `MSG_*` pub struct RecvFlags: i32 { - #[cfg(not(any(windows, target_os = "illumos", target_os = "ios", target_os = "macos")))] + #[cfg(not(any(windows, target_os = "illumos", target_os = "ios", target_os = "macos", target_os = "solaris")))] /// `MSG_CMSG_CLOEXEC` const CMSG_CLOEXEC = c::MSG_CMSG_CLOEXEC; /// `MSG_DONTWAIT` @@ -63,6 +65,7 @@ bitflags! { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] const ERRQUEUE = c::MSG_ERRQUEUE; /// `MSG_OOB` diff --git a/src/backend/libc/net/types.rs b/src/backend/libc/net/types.rs index 63e3a317e..53f1af3d9 100644 --- a/src/backend/libc/net/types.rs +++ b/src/backend/libc/net/types.rs @@ -69,6 +69,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const NETLINK: Self = Self(c::AF_NETLINK as _); /// `AF_UNIX`, aka `AF_LOCAL` @@ -84,6 +85,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const AX25: Self = Self(c::AF_AX25 as _); /// `AF_IPX` @@ -100,6 +102,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const NETROM: Self = Self(c::AF_NETROM as _); /// `AF_BRIDGE` @@ -112,6 +115,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const BRIDGE: Self = Self(c::AF_BRIDGE as _); /// `AF_ATMPVC` @@ -124,6 +128,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const ATMPVC: Self = Self(c::AF_ATMPVC as _); /// `AF_X25` @@ -147,6 +152,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const ROSE: Self = Self(c::AF_ROSE as _); /// `AF_DECnet` @@ -162,6 +168,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const NETBEUI: Self = Self(c::AF_NETBEUI as _); /// `AF_SECURITY` @@ -174,6 +181,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const SECURITY: Self = Self(c::AF_SECURITY as _); /// `AF_KEY` @@ -208,6 +216,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const ASH: Self = Self(c::AF_ASH as _); /// `AF_ECONET` @@ -220,6 +229,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const ECONET: Self = Self(c::AF_ECONET as _); /// `AF_ATMSVC` @@ -232,6 +242,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const ATMSVC: Self = Self(c::AF_ATMSVC as _); /// `AF_RDS` @@ -244,6 +255,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const RDS: Self = Self(c::AF_RDS as _); /// `AF_SNA` @@ -257,6 +269,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const IRDA: Self = Self(c::AF_IRDA as _); /// `AF_PPPOX` @@ -269,6 +282,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const PPPOX: Self = Self(c::AF_PPPOX as _); /// `AF_WANPIPE` @@ -281,6 +295,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const WANPIPE: Self = Self(c::AF_WANPIPE as _); /// `AF_LLC` @@ -293,6 +308,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const LLC: Self = Self(c::AF_LLC as _); /// `AF_CAN` @@ -305,6 +321,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const CAN: Self = Self(c::AF_CAN as _); /// `AF_TIPC` @@ -317,10 +334,11 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const TIPC: Self = Self(c::AF_TIPC as _); /// `AF_BLUETOOTH` - #[cfg(not(any(windows, target_os = "illumos", target_os = "ios", target_os = "macos")))] + #[cfg(not(any(windows, target_os = "illumos", target_os = "ios", target_os = "macos", target_os = "solaris")))] pub const BLUETOOTH: Self = Self(c::AF_BLUETOOTH as _); /// `AF_IUCV` #[cfg(not(any( @@ -332,6 +350,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const IUCV: Self = Self(c::AF_IUCV as _); /// `AF_RXRPC` @@ -344,10 +363,11 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const RXRPC: Self = Self(c::AF_RXRPC as _); /// `AF_ISDN` - #[cfg(not(any(windows, target_os = "illumos")))] + #[cfg(not(any(windows, target_os = "illumos", target_os = "solaris")))] pub const ISDN: Self = Self(c::AF_ISDN as _); /// `AF_PHONET` #[cfg(not(any( @@ -359,6 +379,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const PHONET: Self = Self(c::AF_PHONET as _); /// `AF_IEEE802154` @@ -371,6 +392,7 @@ impl AddressFamily { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const IEEE802154: Self = Self(c::AF_IEEE802154 as _); @@ -403,26 +425,26 @@ impl Protocol { /// `IPPROTO_ICMP` pub const ICMP: Self = Self(c::IPPROTO_ICMP as _); /// `IPPROTO_IGMP` - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] pub const IGMP: Self = Self(c::IPPROTO_IGMP as _); /// `IPPROTO_IPIP` - #[cfg(not(any(windows, target_os = "illumos")))] + #[cfg(not(any(windows, target_os = "illumos", target_os = "solaris")))] pub const IPIP: Self = Self(c::IPPROTO_IPIP as _); /// `IPPROTO_TCP` pub const TCP: Self = Self(c::IPPROTO_TCP as _); /// `IPPROTO_EGP` - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] pub const EGP: Self = Self(c::IPPROTO_EGP as _); /// `IPPROTO_PUP` - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] pub const PUP: Self = Self(c::IPPROTO_PUP as _); /// `IPPROTO_UDP` pub const UDP: Self = Self(c::IPPROTO_UDP as _); /// `IPPROTO_IDP` - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] pub const IDP: Self = Self(c::IPPROTO_IDP as _); /// `IPPROTO_TP` - #[cfg(not(any(windows, target_os = "illumos")))] + #[cfg(not(any(windows, target_os = "illumos", target_os = "solaris")))] pub const TP: Self = Self(c::IPPROTO_TP as _); /// `IPPROTO_DCCP` #[cfg(not(any( @@ -432,21 +454,22 @@ impl Protocol { target_os = "ios", target_os = "macos", target_os = "openbsd", + target_os = "solaris", )))] pub const DCCP: Self = Self(c::IPPROTO_DCCP as _); /// `IPPROTO_IPV6` pub const IPV6: Self = Self(c::IPPROTO_IPV6 as _); /// `IPPROTO_RSVP` - #[cfg(not(any(windows, target_os = "illumos")))] + #[cfg(not(any(windows, target_os = "illumos", target_os = "solaris")))] pub const RSVP: Self = Self(c::IPPROTO_RSVP as _); /// `IPPROTO_GRE` - #[cfg(not(any(windows, target_os = "illumos")))] + #[cfg(not(any(windows, target_os = "illumos", target_os = "solaris")))] pub const GRE: Self = Self(c::IPPROTO_GRE as _); /// `IPPROTO_ESP` - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] pub const ESP: Self = Self(c::IPPROTO_ESP as _); /// `IPPROTO_AH` - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] pub const AH: Self = Self(c::IPPROTO_AH as _); /// `IPPROTO_MTP` #[cfg(not(any( @@ -454,6 +477,7 @@ impl Protocol { target_os = "illumos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const MTP: Self = Self(c::IPPROTO_MTP as _); /// `IPPROTO_BEETPH` @@ -466,13 +490,14 @@ impl Protocol { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const BEETPH: Self = Self(c::IPPROTO_BEETPH as _); /// `IPPROTO_ENCAP` - #[cfg(not(any(windows, target_os = "illumos")))] + #[cfg(not(any(windows, target_os = "illumos", target_os = "solaris")))] pub const ENCAP: Self = Self(c::IPPROTO_ENCAP as _); /// `IPPROTO_PIM` - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] pub const PIM: Self = Self(c::IPPROTO_PIM as _); /// `IPPROTO_COMP` #[cfg(not(any( @@ -484,10 +509,11 @@ impl Protocol { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const COMP: Self = Self(c::IPPROTO_COMP as _); /// `IPPROTO_SCTP` - #[cfg(not(any(target_os = "dragonfly", target_os = "illumos", target_os = "openbsd")))] + #[cfg(not(any(target_os = "dragonfly", target_os = "illumos", target_os = "openbsd", target_os = "solaris")))] pub const SCTP: Self = Self(c::IPPROTO_SCTP as _); /// `IPPROTO_UDPLITE` #[cfg(not(any( @@ -498,6 +524,7 @@ impl Protocol { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const UDPLITE: Self = Self(c::IPPROTO_UDPLITE as _); /// `IPPROTO_MPLS` @@ -508,6 +535,7 @@ impl Protocol { target_os = "ios", target_os = "macos", target_os = "netbsd", + target_os = "solaris", )))] pub const MPLS: Self = Self(c::IPPROTO_MPLS as _); /// `IPPROTO_RAW` @@ -525,10 +553,11 @@ impl Protocol { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const MPTCP: Self = Self(c::IPPROTO_MPTCP as _); /// `IPPROTO_FRAGMENT` - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] pub const FRAGMENT: Self = Self(c::IPPROTO_FRAGMENT as _); /// `IPPROTO_ICMPV6` pub const ICMPV6: Self = Self(c::IPPROTO_ICMPV6 as _); @@ -541,10 +570,11 @@ impl Protocol { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const MH: Self = Self(c::IPPROTO_MH as _); /// `IPPROTO_ROUTING` - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] pub const ROUTING: Self = Self(c::IPPROTO_ROUTING as _); /// Constructs a `Protocol` from a raw integer. diff --git a/src/backend/libc/offset.rs b/src/backend/libc/offset.rs index beb16d918..028cb9939 100644 --- a/src/backend/libc/offset.rs +++ b/src/backend/libc/offset.rs @@ -176,6 +176,7 @@ pub(super) use c::fallocate64 as libc_fallocate; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub(super) use c::posix_fadvise as libc_posix_fadvise; #[cfg(any( @@ -292,6 +293,7 @@ mod readwrite_pv64 { target_os = "linux", target_os = "macos", target_os = "redox", + target_os = "solaris", )))] pub(super) use c::{preadv as libc_preadv, pwritev as libc_pwritev}; #[cfg(target_os = "android")] @@ -335,6 +337,7 @@ pub(super) use readwrite_pv::{preadv as libc_preadv, pwritev as libc_pwritev}; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub(super) use c::posix_fallocate as libc_posix_fallocate; #[cfg(any(target_os = "l4re"))] @@ -348,6 +351,7 @@ pub(super) use c::posix_fallocate64 as libc_posix_fallocate; target_os = "l4re", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] pub(super) use {c::fstatfs as libc_fstatfs, c::statfs as libc_statfs}; @@ -359,6 +363,7 @@ pub(super) use {c::fstatfs as libc_fstatfs, c::statfs as libc_statfs}; target_os = "linux", target_os = "l4re", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] pub(super) use {c::fstatvfs as libc_fstatvfs, c::statvfs as libc_statvfs}; diff --git a/src/backend/libc/process/types.rs b/src/backend/libc/process/types.rs index 60d629d81..e9055c03a 100644 --- a/src/backend/libc/process/types.rs +++ b/src/backend/libc/process/types.rs @@ -56,15 +56,20 @@ pub enum Resource { /// `RLIMIT_CORE` Core = c::RLIMIT_CORE as c::c_int, /// `RLIMIT_RSS` - #[cfg(not(any(target_os = "illumos", target_os = "ios", target_os = "macos")))] + #[cfg(not(any( + target_os = "illumos", + target_os = "ios", + target_os = "macos", + target_os = "solaris", + )))] Rss = c::RLIMIT_RSS as c::c_int, /// `RLIMIT_NPROC` - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] Nproc = c::RLIMIT_NPROC as c::c_int, /// `RLIMIT_NOFILE` Nofile = c::RLIMIT_NOFILE as c::c_int, /// `RLIMIT_MEMLOCK` - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] Memlock = c::RLIMIT_MEMLOCK as c::c_int, /// `RLIMIT_AS` #[cfg(not(target_os = "openbsd"))] @@ -78,6 +83,7 @@ pub enum Resource { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] Locks = c::RLIMIT_LOCKS as c::c_int, /// `RLIMIT_SIGPENDING` @@ -89,6 +95,7 @@ pub enum Resource { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] Sigpending = c::RLIMIT_SIGPENDING as c::c_int, /// `RLIMIT_MSGQUEUE` @@ -100,6 +107,7 @@ pub enum Resource { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] Msgqueue = c::RLIMIT_MSGQUEUE as c::c_int, /// `RLIMIT_NICE` @@ -111,6 +119,7 @@ pub enum Resource { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] Nice = c::RLIMIT_NICE as c::c_int, /// `RLIMIT_RTPRIO` @@ -122,6 +131,7 @@ pub enum Resource { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] Rtprio = c::RLIMIT_RTPRIO as c::c_int, /// `RLIMIT_RTTIME` @@ -135,6 +145,7 @@ pub enum Resource { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] Rttime = c::RLIMIT_RTTIME as c::c_int, } @@ -197,6 +208,7 @@ pub enum Signal { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", all( any(target_os = "android", target_os = "linux"), any(target_arch = "mips", target_arch = "mips64"), @@ -274,6 +286,7 @@ impl Signal { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", all( any(target_os = "android", target_os = "linux"), any(target_arch = "mips", target_arch = "mips64"), diff --git a/src/backend/libc/termios/types.rs b/src/backend/libc/termios/types.rs index 7e6728755..43da9e182 100644 --- a/src/backend/libc/termios/types.rs +++ b/src/backend/libc/termios/types.rs @@ -100,6 +100,7 @@ pub const VMIN: usize = c::VMIN as usize; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const VSWTC: usize = c::VSWTC as usize; @@ -197,6 +198,7 @@ pub const IMAXBEL: c::c_uint = c::IMAXBEL; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const IUTF8: c::c_uint = c::IUTF8; @@ -263,6 +265,7 @@ pub const OFDEL: c::c_uint = c::OFDEL; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const NLDLY: c::c_uint = c::NLDLY; @@ -277,6 +280,7 @@ pub const NLDLY: c::c_uint = c::NLDLY; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const NL0: c::c_uint = c::NL0; @@ -291,6 +295,7 @@ pub const NL0: c::c_uint = c::NL0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const NL1: c::c_uint = c::NL1; @@ -304,6 +309,7 @@ pub const NL1: c::c_uint = c::NL1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const CRDLY: c::c_uint = c::CRDLY; @@ -318,6 +324,7 @@ pub const CRDLY: c::c_uint = c::CRDLY; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const CR0: c::c_uint = c::CR0; @@ -334,6 +341,7 @@ pub const CR0: c::c_uint = c::CR0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const CR1: c::c_uint = c::CR1; @@ -350,6 +358,7 @@ pub const CR1: c::c_uint = c::CR1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const CR2: c::c_uint = c::CR2; @@ -366,6 +375,7 @@ pub const CR2: c::c_uint = c::CR2; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const CR3: c::c_uint = c::CR3; @@ -377,6 +387,7 @@ pub const CR3: c::c_uint = c::CR3; target_os = "openbsd", target_os = "illumos", target_os = "redox", + target_os = "solaris", )))] pub const TABDLY: c::c_uint = c::TABDLY; @@ -389,6 +400,7 @@ pub const TABDLY: c::c_uint = c::TABDLY; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const TAB0: c::c_uint = c::TAB0; @@ -405,6 +417,7 @@ pub const TAB0: c::c_uint = c::TAB0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const TAB1: c::c_uint = c::TAB1; @@ -421,6 +434,7 @@ pub const TAB1: c::c_uint = c::TAB1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const TAB2: c::c_uint = c::TAB2; @@ -435,6 +449,7 @@ pub const TAB2: c::c_uint = c::TAB2; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const TAB3: c::c_uint = c::TAB3; @@ -448,6 +463,7 @@ pub const TAB3: c::c_uint = c::TAB3; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const BSDLY: c::c_uint = c::BSDLY; @@ -462,6 +478,7 @@ pub const BSDLY: c::c_uint = c::BSDLY; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const BS0: c::c_uint = c::BS0; @@ -478,6 +495,7 @@ pub const BS0: c::c_uint = c::BS0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const BS1: c::c_uint = c::BS1; @@ -492,6 +510,7 @@ pub const BS1: c::c_uint = c::BS1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const FFDLY: c::c_uint = c::FFDLY; @@ -506,6 +525,7 @@ pub const FFDLY: c::c_uint = c::FFDLY; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const FF0: c::c_uint = c::FF0; @@ -522,6 +542,7 @@ pub const FF0: c::c_uint = c::FF0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const FF1: c::c_uint = c::FF1; @@ -536,6 +557,7 @@ pub const FF1: c::c_uint = c::FF1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const VTDLY: c::c_uint = c::VTDLY; @@ -550,6 +572,7 @@ pub const VTDLY: c::c_uint = c::VTDLY; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const VT0: c::c_uint = c::VT0; @@ -566,6 +589,7 @@ pub const VT0: c::c_uint = c::VT0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const VT1: c::c_uint = c::VT1; @@ -639,6 +663,7 @@ pub const B460800: Speed = c::B460800; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const B500000: Speed = c::B500000; @@ -651,6 +676,7 @@ pub const B500000: Speed = c::B500000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const B576000: Speed = c::B576000; @@ -666,6 +692,7 @@ pub const B921600: Speed = c::B921600; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const B1000000: Speed = c::B1000000; @@ -677,6 +704,7 @@ pub const B1000000: Speed = c::B1000000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const B1152000: Speed = c::B1152000; @@ -688,6 +716,7 @@ pub const B1152000: Speed = c::B1152000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const B1500000: Speed = c::B1500000; @@ -699,6 +728,7 @@ pub const B1500000: Speed = c::B1500000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const B2000000: Speed = c::B2000000; @@ -710,6 +740,7 @@ pub const B2000000: Speed = c::B2000000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const B2500000: Speed = c::B2500000; @@ -721,6 +752,7 @@ pub const B2500000: Speed = c::B2500000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const B3000000: Speed = c::B3000000; @@ -732,6 +764,7 @@ pub const B3000000: Speed = c::B3000000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const B3500000: Speed = c::B3500000; @@ -743,6 +776,7 @@ pub const B3500000: Speed = c::B3500000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub const B4000000: Speed = c::B4000000; @@ -833,6 +867,7 @@ pub const IEXTEN: c::c_uint = c::IEXTEN; target_os = "ios", target_os = "macos", target_os = "redox", + target_os = "solaris", )))] pub const EXTA: c::c_uint = c::EXTA; @@ -843,6 +878,7 @@ pub const EXTA: c::c_uint = c::EXTA; target_os = "ios", target_os = "macos", target_os = "redox", + target_os = "solaris", )))] pub const EXTB: c::c_uint = c::EXTB; @@ -868,6 +904,7 @@ pub const CBAUD: c::c_uint = c::CBAUD; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const CBAUDEX: c::c_uint = c::CBAUDEX; @@ -902,6 +939,7 @@ pub const CIBAUD: c::tcflag_t = 0o77600000; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const CMSPAR: c::c_uint = c::CMSPAR; @@ -947,5 +985,6 @@ pub const EXTPROC: c::c_uint = c::EXTPROC; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub const XTABS: c::c_uint = c::XTABS; diff --git a/src/backend/libc/time/types.rs b/src/backend/libc/time/types.rs index 4aa2b22e5..080f64431 100644 --- a/src/backend/libc/time/types.rs +++ b/src/backend/libc/time/types.rs @@ -132,6 +132,7 @@ pub enum ClockId { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] ProcessCPUTime = c::CLOCK_PROCESS_CPUTIME_ID, @@ -141,6 +142,7 @@ pub enum ClockId { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] ThreadCPUTime = c::CLOCK_THREAD_CPUTIME_ID, diff --git a/src/fs/abs.rs b/src/fs/abs.rs index 24d1ab711..d624e4344 100644 --- a/src/fs/abs.rs +++ b/src/fs/abs.rs @@ -4,10 +4,16 @@ target_os = "illumos", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] use crate::fs::StatFs; -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] use { crate::fs::StatVfs, crate::{backend, io, path}, @@ -26,6 +32,7 @@ use { target_os = "illumos", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] #[inline] @@ -46,7 +53,12 @@ pub fn statfs(path: P) -> io::Result { /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/statvfs.html /// [Linux]: https://man7.org/linux/man-pages/man2/statvfs.2.html -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] #[inline] pub fn statvfs(path: P) -> io::Result { path.into_with_c_str(backend::fs::syscalls::statvfs) diff --git a/src/fs/at.rs b/src/fs/at.rs index 67310731b..921754a04 100644 --- a/src/fs/at.rs +++ b/src/fs/at.rs @@ -7,7 +7,7 @@ use crate::fd::OwnedFd; use crate::ffi::{CStr, CString}; -#[cfg(not(target_os = "illumos"))] +#[cfg(not(any(target_os = "illumos", target_os = "solaris")))] use crate::fs::Access; #[cfg(any(target_os = "ios", target_os = "macos"))] use crate::fs::CloneFlags; @@ -272,7 +272,7 @@ pub fn statat(dirfd: Fd, path: P, flags: AtFlags) -> io: /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/faccessat.html /// [Linux]: https://man7.org/linux/man-pages/man2/faccessat.2.html -#[cfg(not(target_os = "illumos"))] +#[cfg(not(any(target_os = "illumos", target_os = "solaris")))] #[inline] #[doc(alias = "faccessat")] pub fn accessat( diff --git a/src/fs/fd.rs b/src/fs/fd.rs index b92266585..08f99cdf7 100644 --- a/src/fs/fd.rs +++ b/src/fs/fd.rs @@ -8,7 +8,7 @@ use crate::process::{Gid, Uid}; use crate::{backend, io}; use backend::fd::{AsFd, BorrowedFd}; -#[cfg(not(target_os = "wasi"))] +#[cfg(not(any(target_os = "solaris", target_os = "wasi")))] pub use backend::fs::types::FlockOperation; #[cfg(not(any( @@ -17,6 +17,7 @@ pub use backend::fs::types::FlockOperation; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::fs::types::FallocateFlags; @@ -26,11 +27,17 @@ pub use backend::fs::types::Stat; target_os = "illumos", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] pub use backend::fs::types::StatFs; -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] pub use backend::fs::types::{StatVfs, StatVfsMountFlags}; #[cfg(any(target_os = "android", target_os = "linux"))] @@ -160,6 +167,7 @@ pub fn fstat(fd: Fd) -> io::Result { target_os = "illumos", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] #[inline] @@ -181,7 +189,12 @@ pub fn fstatfs(fd: Fd) -> io::Result { /// /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/fstatvfs.html /// [Linux]: https://man7.org/linux/man-pages/man2/fstatvfs.2.html -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] #[inline] pub fn fstatvfs(fd: Fd) -> io::Result { backend::fs::syscalls::fstatvfs(fd.as_fd()) @@ -221,6 +234,7 @@ pub fn futimens(fd: Fd, times: &Timestamps) -> io::Result<()> { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] // not implemented in libc for netbsd yet #[inline] #[doc(alias = "posix_fallocate")] @@ -320,7 +334,7 @@ pub fn ftruncate(fd: Fd, length: u64) -> io::Result<()> { /// - [Linux] /// /// [Linux]: https://man7.org/linux/man-pages/man2/flock.2.html -#[cfg(not(target_os = "wasi"))] +#[cfg(not(any(target_os = "solaris", target_os = "wasi")))] #[inline] pub fn flock(fd: Fd, operation: FlockOperation) -> io::Result<()> { backend::fs::syscalls::flock(fd.as_fd(), operation) diff --git a/src/fs/mod.rs b/src/fs/mod.rs index 9faded184..54aa0ea73 100644 --- a/src/fs/mod.rs +++ b/src/fs/mod.rs @@ -28,6 +28,7 @@ mod dir; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] mod fadvise; pub(crate) mod fcntl; @@ -48,6 +49,7 @@ mod getpath; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] mod makedev; @@ -65,14 +67,20 @@ mod statx; target_os = "illumos", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] #[cfg(feature = "fs")] pub use abs::statfs; -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] #[cfg(feature = "fs")] pub use abs::statvfs; -#[cfg(not(any(target_os = "illumos", target_os = "redox")))] +#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "solaris",)))] #[cfg(feature = "fs")] pub use at::accessat; #[cfg(any(target_os = "ios", target_os = "macos"))] @@ -132,6 +140,7 @@ pub use dir::{Dir, DirEntry}; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use fadvise::{fadvise, Advice}; #[cfg(not(target_os = "wasi"))] @@ -164,19 +173,28 @@ pub use fd::fdatasync; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use fd::{fallocate, FallocateFlags}; #[cfg(not(target_os = "wasi"))] -pub use fd::{fchmod, fchown, flock, FlockOperation}; +pub use fd::{fchmod, fchown}; +#[cfg(not(any(target_os = "solaris", target_os = "wasi")))] +pub use fd::{flock, FlockOperation}; pub use fd::{fstat, fsync, ftruncate, futimens, is_file_read_write, seek, tell, Stat, Timestamps}; #[cfg(not(any( target_os = "illumos", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] pub use fd::{fstatfs, StatFs}; -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] pub use fd::{fstatvfs, StatVfs, StatVfsMountFlags}; #[cfg(any(target_os = "android", target_os = "linux"))] pub use fd::{FsWord, NFS_SUPER_MAGIC, PROC_SUPER_MAGIC}; @@ -192,6 +210,7 @@ pub use getpath::getpath; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] pub use makedev::{major, makedev, minor}; diff --git a/src/io/mod.rs b/src/io/mod.rs index 4f5d6830e..4d182226b 100644 --- a/src/io/mod.rs +++ b/src/io/mod.rs @@ -50,6 +50,7 @@ pub use pipe::pipe; windows, target_os = "illumos", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] pub use pipe::PIPE_BUF; @@ -60,7 +61,7 @@ pub use poll::{poll, PollFd, PollFlags}; pub use procfs::{proc_self_fd, proc_self_fdinfo_fd, proc_self_maps, proc_self_pagemap}; #[cfg(not(windows))] pub use read_write::{pread, pwrite, read, readv, write, writev, IoSlice, IoSliceMut}; -#[cfg(not(any(windows, target_os = "redox")))] +#[cfg(not(any(windows, target_os = "redox", target_os = "solaris")))] pub use read_write::{preadv, pwritev}; #[cfg(any(target_os = "android", target_os = "linux"))] pub use read_write::{preadv2, pwritev2, ReadWriteFlags}; diff --git a/src/io/pipe.rs b/src/io/pipe.rs index 11ff623d0..b87550162 100644 --- a/src/io/pipe.rs +++ b/src/io/pipe.rs @@ -17,6 +17,7 @@ pub use backend::io::types::PipeFlags; windows, target_os = "illumos", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] pub const PIPE_BUF: usize = backend::io::types::PIPE_BUF; diff --git a/src/io/read_write.rs b/src/io/read_write.rs index c9268d8a9..aa2840fc6 100644 --- a/src/io/read_write.rs +++ b/src/io/read_write.rs @@ -112,7 +112,7 @@ pub fn writev(fd: Fd, bufs: &[IoSlice<'_>]) -> io::Result { /// - [Linux] /// /// [Linux]: https://man7.org/linux/man-pages/man2/preadv.2.html -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "solaris")))] #[inline] pub fn preadv(fd: Fd, bufs: &mut [IoSliceMut<'_>], offset: u64) -> io::Result { backend::io::syscalls::preadv(fd.as_fd(), bufs, offset) @@ -125,7 +125,7 @@ pub fn preadv(fd: Fd, bufs: &mut [IoSliceMut<'_>], offset: u64) -> io: /// - [Linux] /// /// [Linux]: https://man7.org/linux/man-pages/man2/pwritev.2.html -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "solaris")))] #[inline] pub fn pwritev(fd: Fd, bufs: &[IoSlice<'_>], offset: u64) -> io::Result { backend::io::syscalls::pwritev(fd.as_fd(), bufs, offset) diff --git a/src/termios/constants.rs b/src/termios/constants.rs index c3b3687b6..38d9374f5 100644 --- a/src/termios/constants.rs +++ b/src/termios/constants.rs @@ -6,6 +6,7 @@ use crate::backend; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use backend::termios::types::B1000000; #[cfg(not(any( @@ -15,6 +16,7 @@ pub use backend::termios::types::B1000000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use backend::termios::types::B1152000; #[cfg(not(any( @@ -24,6 +26,7 @@ pub use backend::termios::types::B1152000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use backend::termios::types::B1500000; #[cfg(not(any( @@ -33,6 +36,7 @@ pub use backend::termios::types::B1500000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use backend::termios::types::B2000000; #[cfg(not(any( @@ -42,6 +46,7 @@ pub use backend::termios::types::B2000000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use backend::termios::types::B2500000; #[cfg(not(any( @@ -51,6 +56,7 @@ pub use backend::termios::types::B2500000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use backend::termios::types::B3000000; #[cfg(not(any( @@ -60,6 +66,7 @@ pub use backend::termios::types::B3000000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use backend::termios::types::B3500000; #[cfg(not(any( @@ -69,6 +76,7 @@ pub use backend::termios::types::B3500000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use backend::termios::types::B4000000; #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "openbsd")))] @@ -81,6 +89,7 @@ pub use backend::termios::types::B460800; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use backend::termios::types::B500000; #[cfg(not(any( @@ -91,6 +100,7 @@ pub use backend::termios::types::B500000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use backend::termios::types::B576000; #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "openbsd")))] @@ -107,6 +117,7 @@ pub use backend::termios::types::BRKINT; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::BS0; #[cfg(not(any( @@ -121,6 +132,7 @@ pub use backend::termios::types::BS0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::BS1; #[cfg(not(any( @@ -132,6 +144,7 @@ pub use backend::termios::types::BS1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::BSDLY; #[cfg(not(any( @@ -153,6 +166,7 @@ pub use backend::termios::types::CBAUD; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::CBAUDEX; #[cfg(not(any( @@ -178,6 +192,7 @@ pub use backend::termios::types::CLOCAL; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::CMSPAR; #[cfg(not(any( @@ -190,6 +205,7 @@ pub use backend::termios::types::CMSPAR; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::CR0; #[cfg(not(any( @@ -204,6 +220,7 @@ pub use backend::termios::types::CR0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::CR1; #[cfg(not(any( @@ -218,6 +235,7 @@ pub use backend::termios::types::CR1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::CR2; #[cfg(not(any( @@ -232,6 +250,7 @@ pub use backend::termios::types::CR2; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::CR3; #[cfg(not(any( @@ -243,6 +262,7 @@ pub use backend::termios::types::CR3; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::CRDLY; #[cfg(not(any(target_os = "ios", target_os = "macos")))] @@ -281,6 +301,7 @@ pub use backend::termios::types::ECHOPRT; target_os = "ios", target_os = "macos", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::EXTA; #[cfg(not(any( @@ -289,6 +310,7 @@ pub use backend::termios::types::EXTA; target_os = "ios", target_os = "macos", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::EXTB; #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] @@ -303,6 +325,7 @@ pub use backend::termios::types::EXTPROC; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::FF0; #[cfg(not(any( @@ -317,6 +340,7 @@ pub use backend::termios::types::FF0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::FF1; #[cfg(not(any( @@ -329,6 +353,7 @@ pub use backend::termios::types::FF1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::FFDLY; #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] @@ -373,6 +398,7 @@ pub use backend::termios::types::IUCLC; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::IUTF8; #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] @@ -391,6 +417,7 @@ pub use backend::termios::types::IXON; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::NL0; #[cfg(not(any( @@ -403,6 +430,7 @@ pub use backend::termios::types::NL0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::NL1; #[cfg(not(any( @@ -414,6 +442,7 @@ pub use backend::termios::types::NL1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::NLDLY; #[cfg(not(any(target_os = "ios", target_os = "macos")))] @@ -471,6 +500,7 @@ pub use backend::termios::types::PENDIN; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::TAB0; #[cfg(not(any( @@ -485,6 +515,7 @@ pub use backend::termios::types::TAB0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::TAB1; #[cfg(not(any( @@ -499,6 +530,7 @@ pub use backend::termios::types::TAB1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::TAB2; #[cfg(not(any( @@ -511,6 +543,7 @@ pub use backend::termios::types::TAB2; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::TAB3; #[cfg(not(any( @@ -520,6 +553,7 @@ pub use backend::termios::types::TAB3; target_os = "openbsd", target_os = "illumos", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::TABDLY; #[cfg(not(any(target_os = "ios", target_os = "macos")))] @@ -532,6 +566,7 @@ pub use backend::termios::types::TOSTOP; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use backend::termios::types::VSWTC; #[cfg(not(any( @@ -544,6 +579,7 @@ pub use backend::termios::types::VSWTC; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::VT0; #[cfg(not(any( @@ -558,6 +594,7 @@ pub use backend::termios::types::VT0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::VT1; #[cfg(not(any( @@ -570,6 +607,7 @@ pub use backend::termios::types::VT1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::VTDLY; #[cfg(any(linux_raw, all(libc, any(target_arch = "s390x", target_os = "haiku"))))] @@ -583,6 +621,7 @@ pub use backend::termios::types::XCASE; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use backend::termios::types::XTABS; pub use backend::termios::types::{ @@ -628,6 +667,7 @@ pub fn speed_value(speed: backend::termios::types::Speed) -> Option { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] backend::termios::types::B500000 => Some(500_000), #[cfg(not(any( @@ -638,6 +678,7 @@ pub fn speed_value(speed: backend::termios::types::Speed) -> Option { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] backend::termios::types::B576000 => Some(576_000), #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "openbsd")))] @@ -649,6 +690,7 @@ pub fn speed_value(speed: backend::termios::types::Speed) -> Option { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] backend::termios::types::B1000000 => Some(1_000_000), #[cfg(not(any( @@ -658,6 +700,7 @@ pub fn speed_value(speed: backend::termios::types::Speed) -> Option { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] backend::termios::types::B1152000 => Some(1_152_000), #[cfg(not(any( @@ -667,6 +710,7 @@ pub fn speed_value(speed: backend::termios::types::Speed) -> Option { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] backend::termios::types::B1500000 => Some(1_500_000), #[cfg(not(any( @@ -676,6 +720,7 @@ pub fn speed_value(speed: backend::termios::types::Speed) -> Option { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] backend::termios::types::B2000000 => Some(2_000_000), #[cfg(not(any( @@ -685,6 +730,7 @@ pub fn speed_value(speed: backend::termios::types::Speed) -> Option { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] backend::termios::types::B2500000 => Some(2_500_000), #[cfg(not(any( @@ -694,6 +740,7 @@ pub fn speed_value(speed: backend::termios::types::Speed) -> Option { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] backend::termios::types::B3000000 => Some(3_000_000), #[cfg(not(any( @@ -703,6 +750,7 @@ pub fn speed_value(speed: backend::termios::types::Speed) -> Option { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] backend::termios::types::B3500000 => Some(3_500_000), #[cfg(not(any( @@ -712,6 +760,7 @@ pub fn speed_value(speed: backend::termios::types::Speed) -> Option { target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] backend::termios::types::B4000000 => Some(4_000_000), _ => None, diff --git a/src/termios/mod.rs b/src/termios/mod.rs index 79f2f6b38..1c6831077 100644 --- a/src/termios/mod.rs +++ b/src/termios/mod.rs @@ -14,6 +14,7 @@ pub use cf::{cfgetispeed, cfgetospeed, cfmakeraw, cfsetispeed, cfsetospeed, cfse target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use constants::B1000000; #[cfg(not(any( @@ -23,6 +24,7 @@ pub use constants::B1000000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use constants::B1152000; #[cfg(not(any( @@ -32,6 +34,7 @@ pub use constants::B1152000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use constants::B1500000; #[cfg(not(any( @@ -41,6 +44,7 @@ pub use constants::B1500000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use constants::B2000000; #[cfg(not(any( @@ -50,6 +54,7 @@ pub use constants::B2000000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use constants::B2500000; #[cfg(not(any( @@ -59,6 +64,7 @@ pub use constants::B2500000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use constants::B3000000; #[cfg(not(any( @@ -68,6 +74,7 @@ pub use constants::B3000000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use constants::B3500000; #[cfg(not(any( @@ -77,6 +84,7 @@ pub use constants::B3500000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use constants::B4000000; #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "openbsd")))] @@ -89,6 +97,7 @@ pub use constants::B460800; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use constants::B500000; #[cfg(not(any( @@ -99,6 +108,7 @@ pub use constants::B500000; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use constants::B576000; #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "openbsd")))] @@ -115,6 +125,7 @@ pub use constants::BRKINT; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::BS0; #[cfg(not(any( @@ -129,6 +140,7 @@ pub use constants::BS0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::BS1; #[cfg(not(any( @@ -140,6 +152,7 @@ pub use constants::BS1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::BSDLY; #[cfg(not(any( @@ -161,6 +174,7 @@ pub use constants::CBAUD; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::CBAUDEX; #[cfg(not(any( @@ -186,6 +200,7 @@ pub use constants::CLOCAL; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::CMSPAR; #[cfg(not(any( @@ -198,6 +213,7 @@ pub use constants::CMSPAR; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::CR0; #[cfg(not(any( @@ -212,6 +228,7 @@ pub use constants::CR0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::CR1; #[cfg(not(any( @@ -226,6 +243,7 @@ pub use constants::CR1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::CR2; #[cfg(not(any( @@ -240,6 +258,7 @@ pub use constants::CR2; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::CR3; #[cfg(not(any( @@ -251,6 +270,7 @@ pub use constants::CR3; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::CRDLY; #[cfg(not(any(target_os = "ios", target_os = "macos")))] @@ -289,6 +309,7 @@ pub use constants::ECHOPRT; target_os = "ios", target_os = "macos", target_os = "redox", + target_os = "solaris", )))] pub use constants::EXTA; #[cfg(not(any( @@ -297,6 +318,7 @@ pub use constants::EXTA; target_os = "ios", target_os = "macos", target_os = "redox", + target_os = "solaris", )))] pub use constants::EXTB; #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] @@ -311,6 +333,7 @@ pub use constants::EXTPROC; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::FF0; #[cfg(not(any( @@ -325,6 +348,7 @@ pub use constants::FF0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::FF1; #[cfg(not(any( @@ -337,6 +361,7 @@ pub use constants::FF1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::FFDLY; #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] @@ -381,6 +406,7 @@ pub use constants::IUCLC; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::IUTF8; #[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "redox")))] @@ -399,6 +425,7 @@ pub use constants::IXON; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::NL0; #[cfg(not(any( @@ -411,6 +438,7 @@ pub use constants::NL0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::NL1; #[cfg(not(any( @@ -422,6 +450,7 @@ pub use constants::NL1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::NLDLY; #[cfg(not(any(target_os = "ios", target_os = "macos")))] @@ -479,6 +508,7 @@ pub use constants::PENDIN; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::TAB0; #[cfg(not(any( @@ -493,6 +523,7 @@ pub use constants::TAB0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::TAB1; #[cfg(not(any( @@ -507,6 +538,7 @@ pub use constants::TAB1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::TAB2; #[cfg(not(any( @@ -519,6 +551,7 @@ pub use constants::TAB2; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::TAB3; #[cfg(not(any( @@ -528,6 +561,7 @@ pub use constants::TAB3; target_os = "openbsd", target_os = "illumos", target_os = "redox", + target_os = "solaris", )))] pub use constants::TABDLY; #[cfg(not(any(target_os = "ios", target_os = "macos")))] @@ -540,6 +574,7 @@ pub use constants::TOSTOP; target_os = "macos", target_os = "netbsd", target_os = "openbsd", + target_os = "solaris", )))] pub use constants::VSWTC; #[cfg(not(any( @@ -552,6 +587,7 @@ pub use constants::VSWTC; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::VT0; #[cfg(not(any( @@ -566,6 +602,7 @@ pub use constants::VT0; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::VT1; #[cfg(not(any( @@ -578,6 +615,7 @@ pub use constants::VT1; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::VTDLY; #[cfg(any(linux_raw, all(libc, any(target_arch = "s390x", target_os = "haiku"))))] @@ -591,6 +629,7 @@ pub use constants::XCASE; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] pub use constants::XTABS; pub use constants::{ diff --git a/tests/fs/file.rs b/tests/fs/file.rs index aa9d761b6..d7cc29ede 100644 --- a/tests/fs/file.rs +++ b/tests/fs/file.rs @@ -1,7 +1,7 @@ #[cfg(not(target_os = "redox"))] #[test] fn test_file() { - #[cfg(not(target_os = "illumos"))] + #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] rustix::fs::accessat( rustix::fs::cwd(), "Cargo.toml", @@ -48,6 +48,7 @@ fn test_file() { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] rustix::fs::fadvise(&file, 0, 10, rustix::fs::Advice::Normal).unwrap(); @@ -68,6 +69,7 @@ fn test_file() { target_os = "illumos", target_os = "netbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] { @@ -75,7 +77,12 @@ fn test_file() { assert!(statfs.f_blocks > 0); } - #[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] + #[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", + )))] { let statvfs = rustix::fs::fstatvfs(&file).unwrap(); assert!(statvfs.f_frsize > 0); diff --git a/tests/fs/flock.rs b/tests/fs/flock.rs index 1b7df6ffd..d26e1f6ab 100644 --- a/tests/fs/flock.rs +++ b/tests/fs/flock.rs @@ -1,4 +1,4 @@ -#[cfg(not(target_os = "redox"))] +#[cfg(not(any(target_os = "redox", target_os = "solaris")))] #[test] fn test_flock() { use rustix::fs::{cwd, flock, openat, FlockOperation, Mode, OFlags}; diff --git a/tests/fs/invalid_offset.rs b/tests/fs/invalid_offset.rs index 995e302a1..fc10734e6 100644 --- a/tests/fs/invalid_offset.rs +++ b/tests/fs/invalid_offset.rs @@ -38,6 +38,7 @@ fn invalid_offset_seek() { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] #[test] fn invalid_offset_fallocate() { @@ -66,6 +67,7 @@ fn invalid_offset_fallocate() { target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", )))] #[test] fn invalid_offset_fadvise() { diff --git a/tests/fs/main.rs b/tests/fs/main.rs index 0ef54eb53..a0ac6e586 100644 --- a/tests/fs/main.rs +++ b/tests/fs/main.rs @@ -24,6 +24,7 @@ mod long_paths; target_os = "netbsd", target_os = "openbsd", target_os = "redox", + target_os = "solaris", target_os = "wasi", )))] mod makedev; @@ -35,7 +36,12 @@ mod openat; mod openat2; mod readdir; mod renameat; -#[cfg(not(any(target_os = "illumos", target_os = "redox", target_os = "wasi")))] +#[cfg(not(any( + target_os = "illumos", + target_os = "redox", + target_os = "solaris", + target_os = "wasi", +)))] mod statfs; #[cfg(any(target_os = "android", target_os = "linux"))] mod statx; diff --git a/tests/fs/mknodat.rs b/tests/fs/mknodat.rs index fa1c84f69..da4a934c2 100644 --- a/tests/fs/mknodat.rs +++ b/tests/fs/mknodat.rs @@ -12,7 +12,7 @@ fn test_mknodat() { let dir = openat(cwd(), tmp.path(), OFlags::RDONLY, Mode::empty()).unwrap(); // Create a regular file. Not supported on FreeBSD or OpenBSD. - #[cfg(not(any(target_os = "freebsd", target_os = "openbsd")))] + #[cfg(not(any(target_os = "freebsd", target_os = "openbsd", target_os = "solaris")))] { mknodat(&dir, "foo", FileType::RegularFile, Mode::empty(), 0).unwrap(); let stat = statat(&dir, "foo", AtFlags::empty()).unwrap(); diff --git a/tests/io/read_write.rs b/tests/io/read_write.rs index 65186bf21..f1835a396 100644 --- a/tests/io/read_write.rs +++ b/tests/io/read_write.rs @@ -2,6 +2,7 @@ use std::io::{IoSlice, IoSliceMut}; #[cfg(feature = "fs")] +#[cfg(not(target_os = "solaris"))] // no preadv/pwritev #[test] fn test_readwrite_pv() { use rustix::fs::{cwd, openat, Mode, OFlags};