summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/backend/libc/mm
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:39 +0000
commit1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch)
tree3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /vendor/rustix/src/backend/libc/mm
parentReleasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz
rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/src/backend/libc/mm')
-rw-r--r--vendor/rustix/src/backend/libc/mm/syscalls.rs6
-rw-r--r--vendor/rustix/src/backend/libc/mm/types.rs114
2 files changed, 29 insertions, 91 deletions
diff --git a/vendor/rustix/src/backend/libc/mm/syscalls.rs b/vendor/rustix/src/backend/libc/mm/syscalls.rs
index a1d2df1af..16636f1b9 100644
--- a/vendor/rustix/src/backend/libc/mm/syscalls.rs
+++ b/vendor/rustix/src/backend/libc/mm/syscalls.rs
@@ -7,7 +7,7 @@ use super::super::conv::{borrowed_fd, no_fd, ret};
use super::super::offset::libc_mmap;
#[cfg(not(target_os = "redox"))]
use super::types::Advice;
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "emscripten", target_os = "linux"))]
use super::types::MremapFlags;
use super::types::{MapFlags, MprotectFlags, MsyncFlags, ProtFlags};
#[cfg(any(target_os = "android", target_os = "linux"))]
@@ -130,7 +130,7 @@ pub(crate) unsafe fn munmap(ptr: *mut c::c_void, len: usize) -> io::Result<()> {
///
/// `mremap` is primarily unsafe due to the `old_address` parameter, as
/// anything working with memory pointed to by raw pointers is unsafe.
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "emscripten", target_os = "linux"))]
pub(crate) unsafe fn mremap(
old_address: *mut c::c_void,
old_size: usize,
@@ -150,7 +150,7 @@ pub(crate) unsafe fn mremap(
/// `mremap_fixed` is primarily unsafe due to the `old_address` and
/// `new_address` parameters, as anything working with memory pointed to by raw
/// pointers is unsafe.
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "emscripten", target_os = "linux"))]
pub(crate) unsafe fn mremap_fixed(
old_address: *mut c::c_void,
old_size: usize,
diff --git a/vendor/rustix/src/backend/libc/mm/types.rs b/vendor/rustix/src/backend/libc/mm/types.rs
index 11ab708cf..cd6e521d2 100644
--- a/vendor/rustix/src/backend/libc/mm/types.rs
+++ b/vendor/rustix/src/backend/libc/mm/types.rs
@@ -51,165 +51,109 @@ bitflags! {
const SHARED = c::MAP_SHARED;
/// `MAP_SHARED_VALIDATE`
#[cfg(not(any(
+ bsd,
+ solarish,
target_os = "android",
- target_os = "dragonfly",
target_os = "emscripten",
- target_os = "freebsd",
target_os = "fuchsia",
target_os = "haiku",
- target_os = "illumos",
- target_os = "ios",
- target_os = "macos",
- target_os = "netbsd",
- target_os = "openbsd",
target_os = "redox",
- target_os = "solaris",
)))]
const SHARED_VALIDATE = c::MAP_SHARED_VALIDATE;
/// `MAP_PRIVATE`
const PRIVATE = c::MAP_PRIVATE;
/// `MAP_DENYWRITE`
#[cfg(not(any(
- target_os = "dragonfly",
- target_os = "freebsd",
+ bsd,
+ solarish,
target_os = "haiku",
- target_os = "illumos",
- target_os = "ios",
- target_os = "macos",
- target_os = "netbsd",
- target_os = "openbsd",
target_os = "redox",
- target_os = "solaris",
)))]
const DENYWRITE = c::MAP_DENYWRITE;
/// `MAP_FIXED`
const FIXED = c::MAP_FIXED;
/// `MAP_FIXED_NOREPLACE`
#[cfg(not(any(
+ bsd,
+ solarish,
target_os = "android",
- target_os = "dragonfly",
target_os = "emscripten",
- target_os = "freebsd",
target_os = "fuchsia",
target_os = "haiku",
- target_os = "illumos",
- target_os = "ios",
- target_os = "macos",
- target_os = "netbsd",
- target_os = "openbsd",
target_os = "redox",
- target_os = "solaris",
)))]
const FIXED_NOREPLACE = c::MAP_FIXED_NOREPLACE;
/// `MAP_GROWSDOWN`
#[cfg(not(any(
- target_os = "dragonfly",
- target_os = "freebsd",
+ bsd,
+ solarish,
target_os = "haiku",
- target_os = "illumos",
- target_os = "ios",
- target_os = "macos",
- target_os = "netbsd",
- target_os = "openbsd",
target_os = "redox",
- target_os = "solaris",
)))]
const GROWSDOWN = c::MAP_GROWSDOWN;
/// `MAP_HUGETLB`
#[cfg(not(any(
- target_os = "dragonfly",
- target_os = "freebsd",
+ bsd,
+ solarish,
target_os = "haiku",
- target_os = "illumos",
- target_os = "ios",
- target_os = "macos",
- target_os = "netbsd",
- target_os = "openbsd",
target_os = "redox",
- target_os = "solaris",
)))]
const HUGETLB = c::MAP_HUGETLB;
/// `MAP_HUGE_2MB`
#[cfg(not(any(
+ bsd,
+ solarish,
target_os = "android",
- target_os = "dragonfly",
target_os = "emscripten",
- target_os = "freebsd",
target_os = "fuchsia",
target_os = "haiku",
- target_os = "illumos",
- target_os = "ios",
- target_os = "macos",
- target_os = "netbsd",
- target_os = "openbsd",
target_os = "redox",
- target_os = "solaris",
)))]
const HUGE_2MB = c::MAP_HUGE_2MB;
/// `MAP_HUGE_1GB`
#[cfg(not(any(
+ bsd,
+ solarish,
target_os = "android",
- target_os = "dragonfly",
target_os = "emscripten",
- target_os = "freebsd",
target_os = "fuchsia",
target_os = "haiku",
- target_os = "illumos",
- target_os = "ios",
- target_os = "macos",
- target_os = "netbsd",
- target_os = "openbsd",
target_os = "redox",
- target_os = "solaris",
)))]
const HUGE_1GB = c::MAP_HUGE_1GB;
/// `MAP_LOCKED`
#[cfg(not(any(
- target_os = "dragonfly",
- target_os = "freebsd",
+ bsd,
+ solarish,
target_os = "haiku",
- target_os = "illumos",
- target_os = "ios",
- target_os = "macos",
- target_os = "netbsd",
- target_os = "openbsd",
target_os = "redox",
- target_os = "solaris",
)))]
const LOCKED = c::MAP_LOCKED;
/// `MAP_NOCORE`
- #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
+ #[cfg(freebsdlike)]
const NOCORE = c::MAP_NOCORE;
/// `MAP_NORESERVE`
- #[cfg(not(any(target_os = "dragonfly", target_os = "freebsd", target_os = "redox")))]
+ #[cfg(not(any(freebsdlike, target_os = "redox")))]
const NORESERVE = c::MAP_NORESERVE;
/// `MAP_NOSYNC`
- #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
+ #[cfg(freebsdlike)]
const NOSYNC = c::MAP_NOSYNC;
/// `MAP_POPULATE`
#[cfg(not(any(
- target_os = "dragonfly",
- target_os = "freebsd",
+ bsd,
+ solarish,
target_os = "haiku",
- target_os = "illumos",
- target_os = "ios",
- target_os = "macos",
- target_os = "netbsd",
- target_os = "openbsd",
target_os = "redox",
- target_os = "solaris",
)))]
const POPULATE = c::MAP_POPULATE;
/// `MAP_STACK`
#[cfg(not(any(
+ apple,
+ solarish,
target_os = "dragonfly",
target_os = "haiku",
- target_os = "illumos",
- target_os = "ios",
- target_os = "macos",
target_os = "netbsd",
target_os = "redox",
- target_os = "solaris",
)))]
const STACK = c::MAP_STACK;
/// `MAP_PREFAULT_READ`
@@ -217,19 +161,13 @@ bitflags! {
const PREFAULT_READ = c::MAP_PREFAULT_READ;
/// `MAP_SYNC`
#[cfg(not(any(
+ bsd,
+ solarish,
target_os = "android",
- target_os = "dragonfly",
target_os = "emscripten",
- target_os = "freebsd",
target_os = "fuchsia",
target_os = "haiku",
- target_os = "illumos",
- target_os = "ios",
- target_os = "macos",
- 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"),
@@ -242,7 +180,7 @@ bitflags! {
}
}
-#[cfg(target_os = "linux")]
+#[cfg(any(target_os = "emscripten", target_os = "linux"))]
bitflags! {
/// `MREMAP_*` flags for use with [`mremap`].
///