Skip to content

Commit 09177b3

Browse files
committed
expose process_vm_readv, process_vm_writev for android
Signed-off-by: rupansh-arch <rupanshsekar@hotmail.com>
1 parent da49e4f commit 09177b3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/sys/uio.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub fn pread(fd: RawFd, buf: &mut [u8], offset: off_t) -> Result<usize>{
9191
/// therefore not represented in Rust by an actual slice as `IoVec` is. It
9292
/// is used with [`process_vm_readv`](fn.process_vm_readv.html)
9393
/// and [`process_vm_writev`](fn.process_vm_writev.html).
94-
#[cfg(target_os = "linux")]
94+
#[cfg(any(target_os = "linux", target_os = "android"))]
9595
#[repr(C)]
9696
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
9797
pub struct RemoteIoVec {
@@ -115,13 +115,13 @@ pub struct RemoteIoVec {
115115
/// `CAP_SYS_PTRACE`), or you must be running as the same user as the
116116
/// target process and the OS must have unprivileged debugging enabled.
117117
///
118-
/// This function is only available on Linux.
118+
/// This function is only available on Linux and Android
119119
///
120120
/// [`process_vm_writev`(2)]: https://man7.org/linux/man-pages/man2/process_vm_writev.2.html
121121
/// [ptrace]: ../ptrace/index.html
122122
/// [`IoVec`]: struct.IoVec.html
123123
/// [`RemoteIoVec`]: struct.RemoteIoVec.html
124-
#[cfg(target_os = "linux")]
124+
#[cfg(any(target_os = "linux", target_os = "android"))]
125125
pub fn process_vm_writev(
126126
pid: crate::unistd::Pid,
127127
local_iov: &[IoVec<&[u8]>],
@@ -156,7 +156,7 @@ pub fn process_vm_writev(
156156
/// [`ptrace`]: ../ptrace/index.html
157157
/// [`IoVec`]: struct.IoVec.html
158158
/// [`RemoteIoVec`]: struct.RemoteIoVec.html
159-
#[cfg(any(target_os = "linux"))]
159+
#[cfg(any(target_os = "linux", target_os = "android"))]
160160
pub fn process_vm_readv(
161161
pid: crate::unistd::Pid,
162162
local_iov: &[IoVec<&mut [u8]>],

0 commit comments

Comments
 (0)