Skip to content

Commit

Permalink
Merge #1565 #1566
Browse files Browse the repository at this point in the history
1565: Update features::socket_atomic_cloexec r=asomers a=asomers

Several platforms have long supported SOCK_OCLOEXEC.  Mark them as
supporting this feature.

1566: Correct definition of MADV_SOFT_OFFLINE on ppc r=asomers a=asomers

Rust has no "ppc" target_arch.  It should be "powerpc" or "powerpc64".

Co-authored-by: Alan Somers <asomers@gmail.com>
  • Loading branch information
bors[bot] and asomers committed Oct 23, 2021
3 parents e8bee6c + 658458c + 64ecb88 commit 57d4c86
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
16 changes: 11 additions & 5 deletions src/features.rs
Expand Up @@ -94,18 +94,24 @@ mod os {
}
}

#[cfg(any(target_os = "illumos"))]
#[cfg(any(
target_os = "dragonfly", // Since ???
target_os = "freebsd", // Since 10.0
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 {
/// Check if the OS supports atomic close-on-exec for sockets
pub const fn socket_atomic_cloexec() -> bool {
true
}
}

#[cfg(any(target_os = "macos", target_os = "freebsd",
target_os = "dragonfly", target_os = "ios",
target_os = "openbsd", target_os = "netbsd",
target_os = "redox", target_os = "fuchsia",
#[cfg(any(target_os = "macos",
target_os = "ios",
target_os = "fuchsia",
target_os = "solaris"))]
mod os {
/// Check if the OS supports atomic close-on-exec for sockets
Expand Down
3 changes: 2 additions & 1 deletion src/sys/mman.rs
Expand Up @@ -210,7 +210,8 @@ libc_enum!{
all(target_os = "linux", any(
target_arch = "aarch64",
target_arch = "arm",
target_arch = "ppc",
target_arch = "powerpc",
target_arch = "powerpc64",
target_arch = "s390x",
target_arch = "x86",
target_arch = "x86_64",
Expand Down

0 comments on commit 57d4c86

Please sign in to comment.