Skip to content

Commit 81021ad

Browse files
committed
Disable AF_NCA, VSTATUS, VERASE2, and fcntl_lock on Solaris. (#1211)
Recent versions of libc 0.2.x have removed these declarations on Solaris, so remove the code that uses them from rustix.
1 parent c9d06b2 commit 81021ad

File tree

5 files changed

+20
-7
lines changed

5 files changed

+20
-7
lines changed

Diff for: src/backend/libc/fs/syscalls.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ use crate::fs::AtFlags;
3636
target_os = "vita",
3737
)))]
3838
use crate::fs::FallocateFlags;
39-
#[cfg(not(any(target_os = "espidf", target_os = "vita", target_os = "wasi")))]
39+
#[cfg(not(any(
40+
target_os = "espidf",
41+
target_os = "solaris",
42+
target_os = "vita",
43+
target_os = "wasi"
44+
)))]
4045
use crate::fs::FlockOperation;
4146
#[cfg(any(linux_kernel, target_os = "freebsd"))]
4247
use crate::fs::MemfdFlags;
@@ -1252,6 +1257,7 @@ pub(crate) fn fcntl_add_seals(fd: BorrowedFd<'_>, seals: SealFlags) -> io::Resul
12521257
target_os = "espidf",
12531258
target_os = "fuchsia",
12541259
target_os = "redox",
1260+
target_os = "solaris",
12551261
target_os = "vita",
12561262
target_os = "wasi"
12571263
)))]

Diff for: src/backend/libc/fs/types.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,12 @@ bitflags! {
949949
///
950950
/// [`flock`]: crate::fs::flock
951951
/// [`fcntl_lock`]: crate::fs::fcntl_lock
952-
#[cfg(not(any(target_os = "espidf", target_os = "vita", target_os = "wasi")))]
952+
#[cfg(not(any(
953+
target_os = "espidf",
954+
target_os = "solaris",
955+
target_os = "vita",
956+
target_os = "wasi"
957+
)))]
953958
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
954959
#[repr(u32)]
955960
pub enum FlockOperation {

Diff for: src/fs/fcntl.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
target_os = "espidf",
99
target_os = "fuchsia",
1010
target_os = "redox",
11+
target_os = "solaris",
1112
target_os = "vita",
1213
target_os = "wasi"
1314
)))]
@@ -101,6 +102,7 @@ pub fn fcntl_add_seals<Fd: AsFd>(fd: Fd, seals: SealFlags) -> io::Result<()> {
101102
target_os = "espidf",
102103
target_os = "fuchsia",
103104
target_os = "redox",
105+
target_os = "solaris",
104106
target_os = "vita",
105107
target_os = "wasi"
106108
)))]

Diff for: src/net/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ impl AddressFamily {
541541
#[cfg(solarish)]
542542
pub const NBS: Self = Self(c::AF_NBS as _);
543543
/// `AF_NCA`
544-
#[cfg(solarish)]
544+
#[cfg(target_os = "illumos")]
545545
pub const NCA: Self = Self(c::AF_NCA as _);
546546
/// `AF_NDD`
547547
#[cfg(target_os = "aix")]

Diff for: src/termios/types.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1192,11 +1192,11 @@ impl SpecialCodeIndex {
11921192
pub const VDSUSP: Self = Self(c::VDSUSP as usize);
11931193

11941194
/// `VSTATUS`
1195-
#[cfg(any(bsd, solarish, target_os = "hurd"))]
1195+
#[cfg(any(bsd, target_os = "hurd", target_os = "illumos"))]
11961196
pub const VSTATUS: Self = Self(c::VSTATUS as usize);
11971197

11981198
/// `VERASE2`
1199-
#[cfg(any(freebsdlike, solarish))]
1199+
#[cfg(any(freebsdlike, target_os = "illumos"))]
12001200
pub const VERASE2: Self = Self(c::VERASE2 as usize);
12011201
}
12021202

@@ -1272,9 +1272,9 @@ impl core::fmt::Debug for SpecialCodeIndex {
12721272
target_os = "nto"
12731273
))]
12741274
Self::VDSUSP => write!(f, "VDSUSP"),
1275-
#[cfg(any(bsd, solarish, target_os = "hurd"))]
1275+
#[cfg(any(bsd, target_os = "hurd", target_os = "illumos"))]
12761276
Self::VSTATUS => write!(f, "VSTATUS"),
1277-
#[cfg(any(freebsdlike, solarish))]
1277+
#[cfg(any(freebsdlike, target_os = "illumos"))]
12781278
Self::VERASE2 => write!(f, "VERASE2"),
12791279

12801280
_ => write!(f, "unknown"),

0 commit comments

Comments
 (0)