• Home
  • Raw
  • Download

Lines Matching full:pid

6 use crate::unistd::Pid;
59 pid: Pid, in ptrace_other() argument
65 libc::pid_t::from(pid), in ptrace_other()
76 unsafe { ptrace_other(Request::PT_TRACE_ME, Pid::from_raw(0), ptr::null_mut(), 0).map(drop) } in traceme()
81 /// Attaches to the process specified by `pid`, making it a tracee of the calling process.
82 pub fn attach(pid: Pid) -> Result<()> { in attach()
83 unsafe { ptrace_other(Request::PT_ATTACH, pid, ptr::null_mut(), 0).map(drop) } in attach()
88 /// Detaches from the process specified by `pid` allowing it to run freely, optionally delivering a
90 pub fn detach<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> { in detach() argument
96 ptrace_other(Request::PT_DETACH, pid, ptr::null_mut(), data).map(drop) in detach()
102 /// Continues the execution of the process with PID `pid`, optionally
104 pub fn cont<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> { in cont() argument
111 ptrace_other(Request::PT_CONTINUE, pid, 1 as AddressType, data).map(drop) in cont()
118 pub fn kill(pid: Pid) -> Result<()> { in kill()
120 ptrace_other(Request::PT_KILL, pid, 0 as AddressType, 0).map(drop) in kill()
127 /// Advances the execution of the process with PID `pid` by a single step optionally delivering a
133 /// use nix::unistd::Pid;
140 /// match waitpid(Pid::from_raw(-1), None) {
141 /// Ok(WaitStatus::Stopped(pid, Signal::SIGUSR1)) => {
142 /// let _ = step(pid, Signal::SIGUSR1);
157 pub fn step<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> { in step() argument
162 unsafe { ptrace_other(Request::PT_STEP, pid, ptr::null_mut(), data).map(drop) } in step()
166 pub fn read(pid: Pid, addr: AddressType) -> Result<c_int> { in read() argument
170 ptrace_other(Request::PT_READ_D, pid, addr, 0) in read()
175 pub fn write(pid: Pid, addr: AddressType, data: c_int) -> Result<()> { in write() argument
176 unsafe { ptrace_other(Request::PT_WRITE_D, pid, addr, data).map(drop) } in write()