Skip to content

Commit 8d656e3

Browse files
authored
feat: MapFlags::map_hugetlb_with_size_log2 for Android/Fuchsia (#2245)
* feat: MapFlags::map_hugetlb_with_size_log2 for Android/Fuchsia * fmt Cargo.toml * changelog
1 parent cb56e89 commit 8d656e3

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ targets = [
2828
]
2929

3030
[dependencies]
31-
libc = { version = "0.2.148", features = ["extra_traits"] }
31+
libc = { git = "https://github.com/rust-lang/libc", rev = "497ac428bc010b5db9682ecf94cd567b31d53e5c", features = ["extra_traits"] }
3232
bitflags = "2.3.1"
3333
cfg-if = "1.0"
3434
pin-utils = { version = "0.1.0", optional = true }

changelog/2245.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Enable `MapFlags::map_hugetlb_with_size_log2` method for Android/Fuchsia

src/sys/mman.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,7 @@ impl MapFlags {
169169
/// let f = MapFlags::map_hugetlb_with_size_log2(30).unwrap();
170170
/// assert_eq!(f, MapFlags::MAP_HUGETLB | MapFlags::MAP_HUGE_1GB);
171171
/// ```
172-
// TODO: support Andorid and Fuchsia when https://github.com/rust-lang/libc/pull/3444
173-
// will be released
174-
#[cfg(target_os = "linux")]
175-
#[cfg_attr(docsrs, doc(cfg(all())))]
172+
#[cfg(any(linux_android, target_os = "fuchsia"))]
176173
pub fn map_hugetlb_with_size_log2(
177174
huge_page_size_log2: u32,
178175
) -> Option<Self> {

0 commit comments

Comments
 (0)