Skip to content

Commit

Permalink
feat: MapFlags::map_hugetlb_with_size_log2 for Android/Fuchsia (#2245)
Browse files Browse the repository at this point in the history
* feat: MapFlags::map_hugetlb_with_size_log2 for Android/Fuchsia

* fmt Cargo.toml

* changelog
  • Loading branch information
SteveLauC committed Dec 4, 2023
1 parent cb56e89 commit 8d656e3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ targets = [
]

[dependencies]
libc = { version = "0.2.148", features = ["extra_traits"] }
libc = { git = "https://github.com/rust-lang/libc", rev = "497ac428bc010b5db9682ecf94cd567b31d53e5c", features = ["extra_traits"] }
bitflags = "2.3.1"
cfg-if = "1.0"
pin-utils = { version = "0.1.0", optional = true }
Expand Down
1 change: 1 addition & 0 deletions changelog/2245.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enable `MapFlags::map_hugetlb_with_size_log2` method for Android/Fuchsia
5 changes: 1 addition & 4 deletions src/sys/mman.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,7 @@ impl MapFlags {
/// let f = MapFlags::map_hugetlb_with_size_log2(30).unwrap();
/// assert_eq!(f, MapFlags::MAP_HUGETLB | MapFlags::MAP_HUGE_1GB);
/// ```
// TODO: support Andorid and Fuchsia when https://github.com/rust-lang/libc/pull/3444
// will be released
#[cfg(target_os = "linux")]
#[cfg_attr(docsrs, doc(cfg(all())))]
#[cfg(any(linux_android, target_os = "fuchsia"))]
pub fn map_hugetlb_with_size_log2(
huge_page_size_log2: u32,
) -> Option<Self> {
Expand Down

0 comments on commit 8d656e3

Please sign in to comment.