From 0aa9923656b990f8edbcbe33b440d9c9f1243e5e Mon Sep 17 00:00:00 2001 From: rupansh-arch Date: Mon, 18 Oct 2021 03:56:26 +0530 Subject: [PATCH] Squashed commit of the following: commit 7f38609b8eb6e6c1c92a24c7cbc5b75afe894de3 Author: rupansh-arch Date: Mon Oct 18 03:55:30 2021 +0530 CHANGELOG: add process_vm_* entry commit 9d119d52aab71371f6be6c11bf6b8159835d64b4 Author: rupansh-arch Date: Tue Oct 12 23:02:17 2021 +0530 process_vm_*: fix documentation for android commit 09177b33061772687dbc196b3e64ffdf2eb5609b Author: rupansh-arch Date: Sat Jun 27 13:42:03 2020 +0530 expose process_vm_readv, process_vm_writev for android Signed-off-by: rupansh-arch --- CHANGELOG.md | 8 ++++++++ src/sys/uio.rs | 10 +++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccbb3562ec..36d62da51e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). +## [Unreleased] - ReleaseDate +### Added +- Enabled `process_vm_readv` and `process_vm_writev` for Android + (#[1557](https://github.com/nix-rust/nix/pull/1557)) +### Changed +### Fixed +### Removed + ## [0.23.0] - 2021-09-28 ### Added diff --git a/src/sys/uio.rs b/src/sys/uio.rs index 3abcde24fe..7e49d25365 100644 --- a/src/sys/uio.rs +++ b/src/sys/uio.rs @@ -91,7 +91,7 @@ pub fn pread(fd: RawFd, buf: &mut [u8], offset: off_t) -> Result{ /// therefore not represented in Rust by an actual slice as `IoVec` is. It /// is used with [`process_vm_readv`](fn.process_vm_readv.html) /// and [`process_vm_writev`](fn.process_vm_writev.html). -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android"))] #[repr(C)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct RemoteIoVec { @@ -115,13 +115,13 @@ pub struct RemoteIoVec { /// `CAP_SYS_PTRACE`), or you must be running as the same user as the /// target process and the OS must have unprivileged debugging enabled. /// -/// This function is only available on Linux. +/// This function is only available on Linux and Android(SDK23+). /// /// [`process_vm_writev`(2)]: https://man7.org/linux/man-pages/man2/process_vm_writev.2.html /// [ptrace]: ../ptrace/index.html /// [`IoVec`]: struct.IoVec.html /// [`RemoteIoVec`]: struct.RemoteIoVec.html -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android"))] pub fn process_vm_writev( pid: crate::unistd::Pid, local_iov: &[IoVec<&[u8]>], @@ -150,13 +150,13 @@ pub fn process_vm_writev( /// `CAP_SYS_PTRACE`), or you must be running as the same user as the /// target process and the OS must have unprivileged debugging enabled. /// -/// This function is only available on Linux. +/// This function is only available on Linux and Android(SDK23+). /// /// [`process_vm_readv`(2)]: https://man7.org/linux/man-pages/man2/process_vm_readv.2.html /// [`ptrace`]: ../ptrace/index.html /// [`IoVec`]: struct.IoVec.html /// [`RemoteIoVec`]: struct.RemoteIoVec.html -#[cfg(any(target_os = "linux"))] +#[cfg(any(target_os = "linux", target_os = "android"))] pub fn process_vm_readv( pid: crate::unistd::Pid, local_iov: &[IoVec<&mut [u8]>],