diff --git a/src/errno.rs b/src/errno.rs index 555c07bacd..c7a182b6c0 100644 --- a/src/errno.rs +++ b/src/errno.rs @@ -12,9 +12,7 @@ cfg_if! { unsafe fn errno_location() -> *mut c_int { unsafe { libc::__error() } } - } else if #[cfg(any(target_os = "android", - target_os = "netbsd", - target_os = "openbsd"))] { + } else if #[cfg(any(target_os = "android", netbsdlike))] { unsafe fn errno_location() -> *mut c_int { unsafe { libc::__errno() } } diff --git a/src/fcntl.rs b/src/fcntl.rs index 5853b62f12..6bda0c09e2 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -99,10 +99,7 @@ libc_bitflags!( #[cfg(not(solarish))] O_DIRECTORY; /// Implicitly follow each `write()` with an `fdatasync()`. - #[cfg(any(linux_android, - apple_targets, - target_os = "netbsd", - target_os = "openbsd"))] + #[cfg(any(linux_android, apple_targets, netbsdlike))] O_DSYNC; /// Error out if a file was not created. O_EXCL; @@ -150,7 +147,7 @@ libc_bitflags!( /// This should not be combined with `O_WRONLY` or `O_RDONLY`. O_RDWR; /// Similar to `O_DSYNC` but applies to `read`s instead. - #[cfg(any(target_os = "linux", target_os = "netbsd", target_os = "openbsd"))] + #[cfg(any(target_os = "linux", netbsdlike))] O_RSYNC; /// Skip search permission checks. #[cfg(target_os = "netbsd")] diff --git a/src/features.rs b/src/features.rs index b528773d10..d75f6a408a 100644 --- a/src/features.rs +++ b/src/features.rs @@ -99,9 +99,8 @@ mod os { #[cfg(any( freebsdlike, // FreeBSD since 10.0 DragonFlyBSD since ??? + netbsdlike, // NetBSD since 6.0 OpenBSD since 5.7 target_os = "illumos", // Since ??? - target_os = "netbsd", // Since 6.0 - target_os = "openbsd", // Since 5.7 target_os = "redox", // Since 1-july-2020 ))] mod os { diff --git a/src/mount/bsd.rs b/src/mount/bsd.rs index 0e92cd0241..e3fabf21d5 100644 --- a/src/mount/bsd.rs +++ b/src/mount/bsd.rs @@ -61,11 +61,7 @@ libc_bitflags!( #[cfg(any(target_os = "macos", target_os = "freebsd"))] MNT_SNAPSHOT; /// Using soft updates. - #[cfg(any( - freebsdlike, - target_os = "netbsd", - target_os = "openbsd" - ))] + #[cfg(any(freebsdlike, netbsdlike))] MNT_SOFTDEP; /// Directories with the SUID bit set chown new files to their own /// owner. diff --git a/src/mount/mod.rs b/src/mount/mod.rs index 56e9c9a9b2..4d062b0921 100644 --- a/src/mount/mod.rs +++ b/src/mount/mod.rs @@ -5,18 +5,8 @@ mod linux; #[cfg(linux_android)] pub use self::linux::*; -#[cfg(any( - freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd" -))] +#[cfg(any(freebsdlike, netbsdlike, target_os = "macos"))] mod bsd; -#[cfg(any( - freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd" -))] +#[cfg(any(freebsdlike, netbsdlike, target_os = "macos"))] pub use self::bsd::*; diff --git a/src/net/if_.rs b/src/net/if_.rs index 49a3b2abcc..a61b719ca3 100644 --- a/src/net/if_.rs +++ b/src/net/if_.rs @@ -72,10 +72,7 @@ libc_bitflags!( #[cfg(any(linux_android, target_os = "fuchsia"))] IFF_MASTER; /// transmission in progress, tx hardware queue is full - #[cfg(any(target_os = "freebsd", - apple_targets, - target_os = "netbsd", - target_os = "openbsd"))] + #[cfg(any(target_os = "freebsd", apple_targets, netbsdlike))] IFF_OACTIVE; /// Protocol code on board. #[cfg(solarish)] @@ -85,10 +82,7 @@ libc_bitflags!( #[cfg(any(linux_android, target_os = "fuchsia"))] IFF_SLAVE; /// Can't hear own transmissions. - #[cfg(any(freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd"))] + #[cfg(any(freebsdlike, netbsdlike, target_os = "macos"))] IFF_SIMPLEX; /// Supports multicast. (see /// [`netdevice(7)`](https://man7.org/linux/man-pages/man7/netdevice.7.html)) diff --git a/src/sys/aio.rs b/src/sys/aio.rs index 636611cf8b..fbf5b27695 100644 --- a/src/sys/aio.rs +++ b/src/sys/aio.rs @@ -55,8 +55,7 @@ libc_enum! { /// on supported operating systems only, do it like `fdatasync` #[cfg(any(apple_targets, target_os = "linux", - target_os = "netbsd", - target_os = "openbsd"))] + netbsdlike))] O_DSYNC } impl TryFrom diff --git a/src/sys/mman.rs b/src/sys/mman.rs index 6247ea4e17..5e968f052b 100644 --- a/src/sys/mman.rs +++ b/src/sys/mman.rs @@ -134,10 +134,10 @@ libc_bitflags! { /// Rename private pages to a file. /// /// This was removed in FreeBSD 11 and is unused in DragonFlyBSD. - #[cfg(any(target_os = "netbsd", target_os = "openbsd"))] + #[cfg(netbsdlike)] MAP_RENAME; /// Region may contain semaphores. - #[cfg(any(freebsdlike, target_os = "netbsd", target_os = "openbsd"))] + #[cfg(any(freebsdlike, netbsdlike))] MAP_HASSEMAPHORE; /// Region grows down, like a stack. #[cfg(any(linux_android, freebsdlike, target_os = "openbsd"))] diff --git a/src/sys/mod.rs b/src/sys/mod.rs index c29d5ce376..48e7f4e21c 100644 --- a/src/sys/mod.rs +++ b/src/sys/mod.rs @@ -66,13 +66,7 @@ feature! { pub mod pthread; } -#[cfg(any( - linux_android, - freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd" -))] +#[cfg(any(linux_android, freebsdlike, target_os = "macos", netbsdlike))] feature! { #![feature = "ptrace"] #[allow(missing_docs)] diff --git a/src/sys/ptrace/mod.rs b/src/sys/ptrace/mod.rs index f87073fef2..d1dd84b4a9 100644 --- a/src/sys/ptrace/mod.rs +++ b/src/sys/ptrace/mod.rs @@ -6,18 +6,8 @@ mod linux; #[cfg(linux_android)] pub use self::linux::*; -#[cfg(any( - freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd" -))] +#[cfg(any(freebsdlike, netbsdlike, target_os = "macos"))] mod bsd; -#[cfg(any( - freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd" -))] +#[cfg(any(freebsdlike, netbsdlike, target_os = "macos"))] pub use self::bsd::*; diff --git a/src/sys/resource.rs b/src/sys/resource.rs index 14f3e14c21..c0116f080b 100644 --- a/src/sys/resource.rs +++ b/src/sys/resource.rs @@ -47,7 +47,7 @@ libc_enum! { ), repr(i32))] #[non_exhaustive] pub enum Resource { - #[cfg(not(any(target_os = "freebsd", target_os = "netbsd", target_os = "openbsd")))] + #[cfg(not(any(target_os = "freebsd", netbsdlike)))] /// The maximum amount (in bytes) of virtual memory the process is /// allowed to map. RLIMIT_AS, @@ -74,12 +74,7 @@ libc_enum! { /// this process may establish. RLIMIT_LOCKS, - #[cfg(any( - linux_android, - target_os = "freebsd", - target_os = "openbsd", - target_os = "netbsd" - ))] + #[cfg(any(linux_android, target_os = "freebsd", netbsdlike))] /// The maximum size (in bytes) which a process may lock into memory /// using the mlock(2) system call. RLIMIT_MEMLOCK, @@ -97,8 +92,7 @@ libc_enum! { #[cfg(any( linux_android, target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd", + netbsdlike, target_os = "aix", ))] /// The maximum number of simultaneous processes for this user id. @@ -111,8 +105,7 @@ libc_enum! { #[cfg(any(linux_android, target_os = "freebsd", - target_os = "netbsd", - target_os = "openbsd", + netbsdlike, target_os = "aix", ))] /// When there is memory pressure and swap is available, prioritize diff --git a/src/sys/socket/addr.rs b/src/sys/socket/addr.rs index 41d30b03a0..09c1e91d39 100644 --- a/src/sys/socket/addr.rs +++ b/src/sys/socket/addr.rs @@ -209,7 +209,7 @@ pub enum AddressFamily { #[cfg(bsd)] Chaos = libc::AF_CHAOS, /// Novell and Xerox protocol - #[cfg(any(apple_targets, target_os = "netbsd", target_os = "openbsd"))] + #[cfg(any(apple_targets, netbsdlike))] Ns = libc::AF_NS, #[allow(missing_docs)] // Not documented anywhere that I can find #[cfg(bsd)] diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index a145444fa2..1e081dd2ea 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -255,16 +255,14 @@ libc_bitflags! { /// Set non-blocking mode on the new socket #[cfg(any(linux_android, freebsdlike, - target_os = "illumos", - target_os = "netbsd", - target_os = "openbsd"))] + netbsdlike, + target_os = "illumos"))] SOCK_NONBLOCK; /// Set close-on-exec on the new descriptor #[cfg(any(linux_android, freebsdlike, - target_os = "illumos", - target_os = "netbsd", - target_os = "openbsd"))] + netbsdlike, + target_os = "illumos"))] SOCK_CLOEXEC; /// Return `EPIPE` instead of raising `SIGPIPE` #[cfg(target_os = "netbsd")] @@ -329,28 +327,23 @@ libc_bitflags! { /// [open(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html). /// /// Only used in [`recvmsg`](fn.recvmsg.html) function. - #[cfg(any(linux_android, - freebsdlike, - target_os = "netbsd", - target_os = "openbsd"))] + #[cfg(any(linux_android, freebsdlike, netbsdlike))] MSG_CMSG_CLOEXEC; /// Requests not to send `SIGPIPE` errors when the other end breaks the connection. /// (For more details, see [send(2)](https://linux.die.net/man/2/send)). #[cfg(any(linux_android, freebsdlike, solarish, + netbsdlike, target_os = "fuchsia", - target_os = "haiku", - target_os = "netbsd", - target_os = "openbsd"))] + target_os = "haiku"))] MSG_NOSIGNAL; /// Turns on [`MSG_DONTWAIT`] after the first message has been received (only for /// `recvmmsg()`). #[cfg(any(linux_android, + netbsdlike, target_os = "fuchsia", - target_os = "netbsd", target_os = "freebsd", - target_os = "openbsd", target_os = "solaris"))] MSG_WAITFORONE; } @@ -755,21 +748,11 @@ pub enum ControlMessageOwned { #[cfg(feature = "net")] #[cfg_attr(docsrs, doc(cfg(feature = "net")))] Ipv6PacketInfo(libc::in6_pktinfo), - #[cfg(any( - target_os = "freebsd", - apple_targets, - target_os = "netbsd", - target_os = "openbsd", - ))] + #[cfg(any(target_os = "freebsd", apple_targets, netbsdlike))] #[cfg(feature = "net")] #[cfg_attr(docsrs, doc(cfg(feature = "net")))] Ipv4RecvIf(libc::sockaddr_dl), - #[cfg(any( - target_os = "freebsd", - apple_targets, - target_os = "netbsd", - target_os = "openbsd", - ))] + #[cfg(any(target_os = "freebsd", apple_targets, netbsdlike))] #[cfg(feature = "net")] #[cfg_attr(docsrs, doc(cfg(feature = "net")))] Ipv4RecvDstAddr(libc::in_addr), @@ -948,23 +931,13 @@ impl ControlMessageOwned { let info = unsafe { ptr::read_unaligned(p as *const libc::in_pktinfo) }; ControlMessageOwned::Ipv4PacketInfo(info) } - #[cfg(any( - target_os = "freebsd", - apple_targets, - target_os = "netbsd", - target_os = "openbsd", - ))] + #[cfg(any(target_os = "freebsd", apple_targets, netbsdlike))] #[cfg(feature = "net")] (libc::IPPROTO_IP, libc::IP_RECVIF) => { let dl = unsafe { ptr::read_unaligned(p as *const libc::sockaddr_dl) }; ControlMessageOwned::Ipv4RecvIf(dl) }, - #[cfg(any( - target_os = "freebsd", - apple_targets, - target_os = "netbsd", - target_os = "openbsd", - ))] + #[cfg(any(target_os = "freebsd", apple_targets, netbsdlike))] #[cfg(feature = "net")] (libc::IPPROTO_IP, libc::IP_RECVDSTADDR) => { let dl = unsafe { ptr::read_unaligned(p as *const libc::in_addr) }; @@ -1124,10 +1097,7 @@ pub enum ControlMessage<'a> { /// /// For further information, please refer to the /// [`ip(7)`](https://man7.org/linux/man-pages/man7/ip.7.html) man page. - #[cfg(any(target_os = "linux", - target_os = "netbsd", - target_os = "android", - apple_targets))] + #[cfg(any(linux_android, target_os = "netbsd", apple_targets))] #[cfg(feature = "net")] #[cfg_attr(docsrs, doc(cfg(feature = "net")))] Ipv4PacketInfo(&'a libc::in_pktinfo), @@ -1145,7 +1115,7 @@ pub enum ControlMessage<'a> { Ipv6PacketInfo(&'a libc::in6_pktinfo), /// Configure the IPv4 source address with `IP_SENDSRCADDR`. - #[cfg(any(freebsdlike, target_os = "netbsd", target_os = "openbsd"))] + #[cfg(any(freebsdlike, netbsdlike))] #[cfg(feature = "net")] #[cfg_attr(docsrs, doc(cfg(feature = "net")))] Ipv4SendSrcAddr(&'a libc::in_addr), @@ -1268,7 +1238,7 @@ impl<'a> ControlMessage<'a> { target_os = "freebsd", apple_targets))] #[cfg(feature = "net")] ControlMessage::Ipv6PacketInfo(info) => info as *const _ as *const u8, - #[cfg(any(freebsdlike, target_os = "netbsd", target_os = "openbsd"))] + #[cfg(any(freebsdlike, netbsdlike))] #[cfg(feature = "net")] ControlMessage::Ipv4SendSrcAddr(addr) => addr as *const _ as *const u8, #[cfg(any(linux_android, freebsdlike, apple_targets, target_os = "haiku"))] @@ -1330,7 +1300,7 @@ impl<'a> ControlMessage<'a> { target_os = "freebsd", apple_targets))] #[cfg(feature = "net")] ControlMessage::Ipv6PacketInfo(info) => mem::size_of_val(info), - #[cfg(any(freebsdlike, target_os = "netbsd", target_os = "openbsd"))] + #[cfg(any(freebsdlike, netbsdlike))] #[cfg(feature = "net")] ControlMessage::Ipv4SendSrcAddr(addr) => mem::size_of_val(addr), #[cfg(any(linux_android, freebsdlike, apple_targets, target_os = "haiku"))] @@ -1370,7 +1340,7 @@ impl<'a> ControlMessage<'a> { target_os = "freebsd", apple_targets))] #[cfg(feature = "net")] ControlMessage::Ipv6PacketInfo(_) => libc::IPPROTO_IPV6, - #[cfg(any(freebsdlike, target_os = "netbsd", target_os = "openbsd"))] + #[cfg(any(freebsdlike, netbsdlike))] #[cfg(feature = "net")] ControlMessage::Ipv4SendSrcAddr(_) => libc::IPPROTO_IP, #[cfg(any(linux_android, freebsdlike, apple_targets, target_os = "haiku"))] @@ -1415,7 +1385,7 @@ impl<'a> ControlMessage<'a> { target_os = "freebsd", apple_targets))] #[cfg(feature = "net")] ControlMessage::Ipv6PacketInfo(_) => libc::IPV6_PKTINFO, - #[cfg(any(freebsdlike, target_os = "netbsd", target_os = "openbsd"))] + #[cfg(any(freebsdlike, netbsdlike))] #[cfg(feature = "net")] ControlMessage::Ipv4SendSrcAddr(_) => libc::IP_SENDSRCADDR, #[cfg(any(linux_android, freebsdlike, apple_targets, target_os = "haiku"))] @@ -2183,12 +2153,11 @@ pub fn accept(sockfd: RawFd) -> Result { ) ), freebsdlike, + netbsdlike, target_os = "emscripten", target_os = "fuchsia", target_os = "illumos", target_os = "linux", - target_os = "netbsd", - target_os = "openbsd" ))] pub fn accept4(sockfd: RawFd, flags: SockFlag) -> Result { let res = unsafe { diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs index 6776e15627..cad2cce180 100644 --- a/src/sys/socket/sockopt.rs +++ b/src/sys/socket/sockopt.rs @@ -830,13 +830,7 @@ sockopt_impl!( libc::IP_PKTINFO, bool ); -#[cfg(any( - linux_android, - target_os = "freebsd", - apple_targets, - target_os = "netbsd", - target_os = "openbsd", -))] +#[cfg(any(linux_android, target_os = "freebsd", apple_targets, netbsdlike))] #[cfg(feature = "net")] sockopt_impl!( #[cfg_attr(docsrs, doc(cfg(feature = "net")))] @@ -848,12 +842,7 @@ sockopt_impl!( libc::IPV6_RECVPKTINFO, bool ); -#[cfg(any( - target_os = "freebsd", - apple_targets, - target_os = "netbsd", - target_os = "openbsd", -))] +#[cfg(any(target_os = "freebsd", apple_targets, netbsdlike))] #[cfg(feature = "net")] sockopt_impl!( #[cfg_attr(docsrs, doc(cfg(feature = "net")))] @@ -865,12 +854,7 @@ sockopt_impl!( libc::IP_RECVIF, bool ); -#[cfg(any( - target_os = "freebsd", - apple_targets, - target_os = "netbsd", - target_os = "openbsd", -))] +#[cfg(any(target_os = "freebsd", apple_targets, netbsdlike))] #[cfg(feature = "net")] sockopt_impl!( #[cfg_attr(docsrs, doc(cfg(feature = "net")))] diff --git a/src/sys/statfs.rs b/src/sys/statfs.rs index d6ec2a8501..fd754f7a4f 100644 --- a/src/sys/statfs.rs +++ b/src/sys/statfs.rs @@ -11,12 +11,7 @@ use cfg_if::cfg_if; #[cfg(all( feature = "mount", - any( - freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd" - ) + any(freebsdlike, target_os = "macos", netbsdlike) ))] use crate::mount::MntFlags; #[cfg(target_os = "linux")] @@ -429,12 +424,7 @@ impl Statfs { /// Get the mount flags #[cfg(all( feature = "mount", - any( - freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd" - ) + any(freebsdlike, target_os = "macos", netbsdlike) ))] #[allow(clippy::unnecessary_cast)] // Not unnecessary on all arches pub fn flags(&self) -> MntFlags { @@ -636,12 +626,7 @@ impl Debug for Statfs { ds.field("filesystem_id", &self.filesystem_id()); #[cfg(all( feature = "mount", - any( - freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd" - ) + any(freebsdlike, target_os = "macos", netbsdlike) ))] ds.field("flags", &self.flags()); ds.finish() diff --git a/src/sys/termios.rs b/src/sys/termios.rs index 9333adc752..f63c390f1e 100644 --- a/src/sys/termios.rs +++ b/src/sys/termios.rs @@ -277,30 +277,18 @@ libc_enum! { B1800, B2400, B4800, - #[cfg(any(freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd"))] + #[cfg(any(freebsdlike, target_os = "macos", netbsdlike))] B7200, B9600, - #[cfg(any(freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd"))] + #[cfg(any(freebsdlike, target_os = "macos", netbsdlike))] B14400, B19200, - #[cfg(any(freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd"))] + #[cfg(any(freebsdlike, target_os = "macos", netbsdlike))] B28800, B38400, #[cfg(not(target_os = "aix"))] B57600, - #[cfg(any(freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd"))] + #[cfg(any(freebsdlike, target_os = "macos", netbsdlike))] B76800, #[cfg(not(target_os = "aix"))] B115200, @@ -420,8 +408,7 @@ libc_enum! { #[cfg(any(freebsdlike, solarish, target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", + netbsdlike, target_os = "aix"))] VDSUSP, VEOF, @@ -444,8 +431,7 @@ libc_enum! { #[cfg(any(freebsdlike, solarish, target_os = "macos", - target_os = "netbsd", - target_os = "openbsd"))] + netbsdlike))] VSTATUS, VSTOP, VSUSP, @@ -480,8 +466,7 @@ pub use libc::NCCS; freebsdlike, target_os = "aix", target_os = "macos", - target_os = "netbsd", - target_os = "openbsd" + netbsdlike ))] pub use libc::_POSIX_VDISABLE; @@ -594,10 +579,7 @@ libc_bitflags! { FF1 as tcflag_t; #[cfg(bsd)] OXTABS; - #[cfg(any(freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd"))] + #[cfg(any(freebsdlike, target_os = "macos", netbsdlike))] ONOEOT as tcflag_t; // Bitmasks for use with OutputFlags to select specific settings @@ -659,20 +641,13 @@ libc_bitflags! { CIBAUD; #[cfg(linux_android)] CBAUDEX; - #[cfg(any(freebsdlike, - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd"))] + #[cfg(any(freebsdlike, target_os = "macos", netbsdlike))] MDMBUF; - #[cfg(any(target_os = "netbsd", target_os = "openbsd"))] + #[cfg(netbsdlike)] CHWFLOW; - #[cfg(any(freebsdlike, - target_os = "netbsd", - target_os = "openbsd"))] + #[cfg(any(freebsdlike, netbsdlike))] CCTS_OFLOW; - #[cfg(any(freebsdlike, - target_os = "netbsd", - target_os = "openbsd"))] + #[cfg(any(freebsdlike, netbsdlike))] CRTS_IFLOW; #[cfg(freebsdlike)] CDTR_IFLOW; diff --git a/src/unistd.rs b/src/unistd.rs index 7c3a33f809..abdc9bdbaf 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -971,8 +971,7 @@ pub fn execveat, SE: AsRef>( linux_android, freebsdlike, solarish, - target_os = "netbsd", - target_os = "openbsd", + netbsdlike ))] pub fn daemon(nochdir: bool, noclose: bool) -> Result<()> { let res = unsafe { libc::daemon(nochdir as c_int, noclose as c_int) }; @@ -1195,8 +1194,7 @@ feature! { solarish, target_os = "emscripten", target_os = "redox", - target_os = "netbsd", - target_os = "openbsd", + netbsdlike, ))] pub fn pipe2(flags: OFlag) -> Result<(OwnedFd, OwnedFd)> { let mut fds = mem::MaybeUninit::<[OwnedFd; 2]>::uninit(); @@ -1350,12 +1348,7 @@ pub fn chroot(path: &P) -> Result<()> { /// Commit filesystem caches to disk /// /// See also [sync(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/sync.html) -#[cfg(any( - freebsdlike, - target_os = "linux", - target_os = "netbsd", - target_os = "openbsd" -))] +#[cfg(any(freebsdlike, target_os = "linux", netbsdlike))] pub fn sync() { unsafe { libc::sync() }; } @@ -1388,11 +1381,10 @@ pub fn fsync(fd: RawFd) -> Result<()> { #[cfg(any( linux_android, solarish, + netbsdlike, target_os = "freebsd", target_os = "emscripten", target_os = "fuchsia", - target_os = "netbsd", - target_os = "openbsd", ))] #[inline] pub fn fdatasync(fd: RawFd) -> Result<()> { @@ -1962,9 +1954,8 @@ feature! { pub enum PathconfVar { #[cfg(any( freebsdlike, + netbsdlike, target_os = "linux", - target_os = "netbsd", - target_os = "openbsd", target_os = "redox" ))] /// Minimum number of bits needed to represent, as a signed integer value, @@ -1992,9 +1983,8 @@ pub enum PathconfVar { #[cfg(any( linux_android, solarish, + netbsdlike, target_os = "dragonfly", - target_os = "netbsd", - target_os = "openbsd", target_os = "redox", ))] /// Symbolic links can be created. @@ -2044,8 +2034,7 @@ pub enum PathconfVar { linux_android, freebsdlike, solarish, - target_os = "netbsd", - target_os = "openbsd", + netbsdlike, target_os = "redox", ))] /// Maximum number of bytes in a symbolic link. @@ -2084,8 +2073,7 @@ pub enum PathconfVar { linux_android, freebsdlike, solarish, - target_os = "netbsd", - target_os = "openbsd", + netbsdlike, target_os = "redox", ))] /// Synchronized input or output operations may be performed for the @@ -2415,8 +2403,7 @@ pub enum SysconfVar { #[cfg(any( apple_targets, target_os = "linux", - target_os = "netbsd", - target_os = "openbsd" + netbsdlike, ))] /// The implementation supports the Thread CPU-Time Clocks option. _POSIX_THREAD_CPUTIME = libc::_SC_THREAD_CPUTIME,