From e357d60cde1c3cf04ac4c17d33e5056c15028459 Mon Sep 17 00:00:00 2001 From: Felix Obenhuber Date: Mon, 25 Jul 2022 08:56:48 +0200 Subject: [PATCH] Add memfd for target_os = "android" Memory fds (`memfd`) are implemented and exported by Androids bionic. Export the `memfd` module if the target os is `android`. https://cs.android.com/android/platform/superproject/+/master:bionic/libc/include/sys/mman.h;drc=23c7543b8e608ebcbb38b952761b54bb56065577;bpv=1;bpt=1;l=182 --- CHANGELOG.md | 2 ++ src/sys/mod.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9e7f6dcd6..6609e11428 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] - ReleaseDate ### Added +- Added `memfd` on Android. + (#[1773](https://github.com/nix-rust/nix/pull/1773)) - Added ETH_P_ALL to SockProtocol enum (#[1768](https://github.com/nix-rust/nix/pull/1768)) - Added four non-standard Linux `SysconfVar` variants diff --git a/src/sys/mod.rs b/src/sys/mod.rs index ddd4fdfc3b..80c75e1fb9 100644 --- a/src/sys/mod.rs +++ b/src/sys/mod.rs @@ -50,7 +50,7 @@ feature! { #[macro_use] pub mod ioctl; -#[cfg(target_os = "linux")] +#[cfg(any(target_is = "android", target_os = "linux"))] feature! { #![feature = "fs"] pub mod memfd;