diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-02-07 18:07:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-07 18:07:44 +0000 |
commit | 432fb906150599c0072420f9524ac42080e1ca20 (patch) | |
tree | 58014f5fa6dd6ace214a7684ac9eb7ca783613f1 | |
parent | 0244b83ea2459abbca836f227bf5af8c7b14fecf (diff) | |
parent | abd76aa75963904add5ac00364b887f13241cb7a (diff) | |
download | nix-432fb906150599c0072420f9524ac42080e1ca20.zip |
Merge #1557
1557: expose process_vm_readv, process_vm_writev for android r=rtzoeller a=rupansh
see https://github.com/rust-lang/libc/pull/1878
Co-authored-by: rupansh-arch <rupanshsekar@hotmail.com>
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | src/sys/uio.rs | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 82f89bb2..dc8143b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). (#[1654](https://github.com/nix-rust/nix/pull/1654)) - Added `AsRawFd` implementation on `OwningIter`. (#[1563](https://github.com/nix-rust/nix/pull/1563)) +- Added `process_vm_readv` and `process_vm_writev` on Android. + (#[1557](https://github.com/nix-rust/nix/pull/1557)) ### Changed diff --git a/src/sys/uio.rs b/src/sys/uio.rs index d9b3bb16..42298300 100644 --- a/src/sys/uio.rs +++ b/src/sys/uio.rs @@ -97,7 +97,7 @@ pub fn pread(fd: RawFd, buf: &mut [u8], offset: off_t) -> Result<usize>{ /// 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"))] #[cfg_attr(docsrs, doc(cfg(all())))] #[repr(C)] #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] @@ -125,13 +125,13 @@ feature! { /// `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(all(target_os = "linux", not(target_env = "uclibc")))] +#[cfg(all(any(target_os = "linux", target_os = "android"), not(target_env = "uclibc")))] pub fn process_vm_writev( pid: crate::unistd::Pid, local_iov: &[IoVec<&[u8]>], @@ -160,13 +160,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(all(target_os = "linux", not(target_env = "uclibc")))] +#[cfg(all(any(target_os = "linux", target_os = "android"), not(target_env = "uclibc")))] pub fn process_vm_readv( pid: crate::unistd::Pid, local_iov: &[IoVec<&mut [u8]>], |