Skip to content

Commit

Permalink
Merge #1557
Browse files Browse the repository at this point in the history
1557: expose process_vm_readv, process_vm_writev for android r=rtzoeller a=rupansh

see rust-lang/libc#1878

Co-authored-by: rupansh-arch <rupanshsekar@hotmail.com>
  • Loading branch information
bors[bot] and rupansh authored Feb 3, 2022
2 parents 2143ffe + 1c66fd8 commit 3e79c23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
(#[1636](https://github.com/nix-rust/nix/pull/1636))
- Added `fspacectl` on FreeBSD
(#[1640](https://github.com/nix-rust/nix/pull/1640))
- Added `process_vm_readv` and `process_vm_writev` on Android.
(#[1557](https://github.com/nix-rust/nix/pull/1557))

### Changed

Expand Down
10 changes: 5 additions & 5 deletions src/sys/uio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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]>],
Expand Down Expand Up @@ -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]>],
Expand Down

0 comments on commit 3e79c23

Please sign in to comment.