summaryrefslogtreecommitdiff
path: root/src/sys/ptrace
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/ptrace')
-rw-r--r--src/sys/ptrace/bsd.rs5
-rw-r--r--src/sys/ptrace/linux.rs5
2 files changed, 9 insertions, 1 deletions
diff --git a/src/sys/ptrace/bsd.rs b/src/sys/ptrace/bsd.rs
index a62881ef..ac7d8312 100644
--- a/src/sys/ptrace/bsd.rs
+++ b/src/sys/ptrace/bsd.rs
@@ -30,10 +30,12 @@ libc_enum! {
PT_READ_I,
PT_READ_D,
#[cfg(target_os = "macos")]
+ #[cfg_attr(docsrs, doc(cfg(all())))]
PT_READ_U,
PT_WRITE_I,
PT_WRITE_D,
#[cfg(target_os = "macos")]
+ #[cfg_attr(docsrs, doc(cfg(all())))]
PT_WRITE_U,
PT_CONTINUE,
PT_KILL,
@@ -47,10 +49,13 @@ libc_enum! {
PT_ATTACH,
PT_DETACH,
#[cfg(target_os = "macos")]
+ #[cfg_attr(docsrs, doc(cfg(all())))]
PT_SIGEXC,
#[cfg(target_os = "macos")]
+ #[cfg_attr(docsrs, doc(cfg(all())))]
PT_THUPDATE,
#[cfg(target_os = "macos")]
+ #[cfg_attr(docsrs, doc(cfg(all())))]
PT_ATTACHEXC
}
}
diff --git a/src/sys/ptrace/linux.rs b/src/sys/ptrace/linux.rs
index 37236790..fb6ff199 100644
--- a/src/sys/ptrace/linux.rs
+++ b/src/sys/ptrace/linux.rs
@@ -99,8 +99,10 @@ libc_enum!{
target_arch = "mips64"))))]
PTRACE_SETREGSET,
#[cfg(target_os = "linux")]
+ #[cfg_attr(docsrs, doc(cfg(all())))]
PTRACE_SEIZE,
#[cfg(target_os = "linux")]
+ #[cfg_attr(docsrs, doc(cfg(all())))]
PTRACE_INTERRUPT,
#[cfg(all(target_os = "linux", not(any(target_arch = "mips",
target_arch = "mips64"))))]
@@ -171,7 +173,6 @@ libc_bitflags! {
PTRACE_O_TRACESECCOMP;
/// Send a SIGKILL to the tracee if the tracer exits. This is useful
/// for ptrace jailers to prevent tracees from escaping their control.
- #[cfg(any(target_os = "android", target_os = "linux"))]
PTRACE_O_EXITKILL;
}
}
@@ -340,6 +341,7 @@ pub fn attach(pid: Pid) -> Result<()> {
///
/// Attaches to the process specified in pid, making it a tracee of the calling process.
#[cfg(target_os = "linux")]
+#[cfg_attr(docsrs, doc(cfg(all())))]
pub fn seize(pid: Pid, options: Options) -> Result<()> {
unsafe {
ptrace_other(
@@ -388,6 +390,7 @@ pub fn cont<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> {
///
/// This request is equivalent to `ptrace(PTRACE_INTERRUPT, ...)`
#[cfg(target_os = "linux")]
+#[cfg_attr(docsrs, doc(cfg(all())))]
pub fn interrupt(pid: Pid) -> Result<()> {
unsafe {
ptrace_other(Request::PTRACE_INTERRUPT, pid, ptr::null_mut(), ptr::null_mut()).map(drop)