Lines Matching full:pid
8 use crate::unistd::Pid;
177 fn ptrace_peek(request: Request, pid: Pid, addr: AddressType, data: *mut c_void) -> Result<c_long> { in ptrace_peek() argument
180 libc::ptrace(request as RequestType, libc::pid_t::from(pid), addr, data) in ptrace_peek()
195 pub fn getregs(pid: Pid) -> Result<user_regs_struct> { in getregs()
196 ptrace_get_data::<user_regs_struct>(Request::PTRACE_GETREGS, pid) in getregs()
206 pub fn setregs(pid: Pid, regs: user_regs_struct) -> Result<()> { in setregs() argument
209 libc::pid_t::from(pid), in setregs()
220 fn ptrace_get_data<T>(request: Request, pid: Pid) -> Result<T> { in ptrace_get_data()
224 libc::pid_t::from(pid), in ptrace_get_data()
232 unsafe fn ptrace_other(request: Request, pid: Pid, addr: AddressType, data: *mut c_void) -> Result<… in ptrace_other() argument
233 … Errno::result(libc::ptrace(request as RequestType, libc::pid_t::from(pid), addr, data)).map(|_| 0) in ptrace_other()
237 pub fn setoptions(pid: Pid, options: Options) -> Result<()> { in setoptions() argument
240 libc::pid_t::from(pid), in setoptions()
248 pub fn getevent(pid: Pid) -> Result<c_long> { in getevent()
249 ptrace_get_data::<c_long>(Request::PTRACE_GETEVENTMSG, pid) in getevent()
253 pub fn getsiginfo(pid: Pid) -> Result<siginfo_t> { in getsiginfo()
254 ptrace_get_data::<siginfo_t>(Request::PTRACE_GETSIGINFO, pid) in getsiginfo()
258 pub fn setsiginfo(pid: Pid, sig: &siginfo_t) -> Result<()> { in setsiginfo() argument
262 libc::pid_t::from(pid), in setsiginfo()
280 Pid::from_raw(0), in traceme()
291 pub fn syscall<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> { in syscall() argument
299 pid, in syscall()
312 pub fn sysemu<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> { in sysemu() argument
318 ptrace_other(Request::PTRACE_SYSEMU, pid, ptr::null_mut(), data).map(drop) in sysemu()
325 /// Attaches to the process specified by `pid`, making it a tracee of the calling process.
326 pub fn attach(pid: Pid) -> Result<()> { in attach()
330 pid, in attach()
339 /// Attaches to the process specified in pid, making it a tracee of the calling process.
341 pub fn seize(pid: Pid, options: Options) -> Result<()> { in seize() argument
345 pid, in seize()
354 /// Detaches from the process specified by `pid` allowing it to run freely, optionally delivering a
356 pub fn detach<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> { in detach() argument
364 pid, in detach()
373 /// Continues the execution of the process with PID `pid`, optionally
375 pub fn cont<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> { in cont() argument
381 …ptrace_other(Request::PTRACE_CONT, pid, ptr::null_mut(), data).map(drop) // ignore the useless ret… in cont()
388 pub fn kill(pid: Pid) -> Result<()> { in kill()
390 ptrace_other(Request::PTRACE_KILL, pid, ptr::null_mut(), ptr::null_mut()).map(drop) in kill()
397 /// Advances the execution of the process with PID `pid` by a single step optionally delivering a
403 /// use nix::unistd::Pid;
410 /// match waitpid(Pid::from_raw(-1), None) {
411 /// Ok(WaitStatus::Stopped(pid, Signal::SIGUSR1)) => {
412 /// let _ = step(pid, Signal::SIGUSR1);
418 pub fn step<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> { in step() argument
424 ptrace_other(Request::PTRACE_SINGLESTEP, pid, ptr::null_mut(), data).map(drop) in step()
435 pub fn sysemu_step<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> { in sysemu_step() argument
443 pid, in sysemu_step()
452 pub fn read(pid: Pid, addr: AddressType) -> Result<c_long> { in read() argument
453 ptrace_peek(Request::PTRACE_PEEKDATA, pid, addr, ptr::null_mut()) in read()
463 pid: Pid, in write() argument
467 ptrace_other(Request::PTRACE_POKEDATA, pid, addr, data).map(drop) in write()