Skip to content

Commit 3e79c23

Browse files
bors[bot]rupansh
andauthored
Merge #1557
1557: expose process_vm_readv, process_vm_writev for android r=rtzoeller a=rupansh see rust-lang/libc#1878 Co-authored-by: rupansh-arch <[email protected]>
2 parents 2143ffe + 1c66fd8 commit 3e79c23

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
3939
(#[1636](https://github.com/nix-rust/nix/pull/1636))
4040
- Added `fspacectl` on FreeBSD
4141
(#[1640](https://github.com/nix-rust/nix/pull/1640))
42+
- Added `process_vm_readv` and `process_vm_writev` on Android.
43+
(#[1557](https://github.com/nix-rust/nix/pull/1557))
4244

4345
### Changed
4446

Diff for: src/sys/uio.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub fn pread(fd: RawFd, buf: &mut [u8], offset: off_t) -> Result<usize>{
9797
/// therefore not represented in Rust by an actual slice as `IoVec` is. It
9898
/// is used with [`process_vm_readv`](fn.process_vm_readv.html)
9999
/// and [`process_vm_writev`](fn.process_vm_writev.html).
100-
#[cfg(target_os = "linux")]
100+
#[cfg(any(target_os = "linux", target_os = "android"))]
101101
#[cfg_attr(docsrs, doc(cfg(all())))]
102102
#[repr(C)]
103103
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
@@ -125,13 +125,13 @@ feature! {
125125
/// `CAP_SYS_PTRACE`), or you must be running as the same user as the
126126
/// target process and the OS must have unprivileged debugging enabled.
127127
///
128-
/// This function is only available on Linux.
128+
/// This function is only available on Linux and Android(SDK23+).
129129
///
130130
/// [`process_vm_writev`(2)]: https://man7.org/linux/man-pages/man2/process_vm_writev.2.html
131131
/// [ptrace]: ../ptrace/index.html
132132
/// [`IoVec`]: struct.IoVec.html
133133
/// [`RemoteIoVec`]: struct.RemoteIoVec.html
134-
#[cfg(all(target_os = "linux", not(target_env = "uclibc")))]
134+
#[cfg(all(any(target_os = "linux", target_os = "android"), not(target_env = "uclibc")))]
135135
pub fn process_vm_writev(
136136
pid: crate::unistd::Pid,
137137
local_iov: &[IoVec<&[u8]>],
@@ -160,13 +160,13 @@ pub fn process_vm_writev(
160160
/// `CAP_SYS_PTRACE`), or you must be running as the same user as the
161161
/// target process and the OS must have unprivileged debugging enabled.
162162
///
163-
/// This function is only available on Linux.
163+
/// This function is only available on Linux and Android(SDK23+).
164164
///
165165
/// [`process_vm_readv`(2)]: https://man7.org/linux/man-pages/man2/process_vm_readv.2.html
166166
/// [`ptrace`]: ../ptrace/index.html
167167
/// [`IoVec`]: struct.IoVec.html
168168
/// [`RemoteIoVec`]: struct.RemoteIoVec.html
169-
#[cfg(all(target_os = "linux", not(target_env = "uclibc")))]
169+
#[cfg(all(any(target_os = "linux", target_os = "android"), not(target_env = "uclibc")))]
170170
pub fn process_vm_readv(
171171
pid: crate::unistd::Pid,
172172
local_iov: &[IoVec<&mut [u8]>],

0 commit comments

Comments
 (0)