File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
2222 ([ #739 ] ( https://github.com/nix-rust/nix/pull/739 ) )
2323- Expose ` signalfd ` module on Android as well.
2424 ([ #739 ] ( https://github.com/nix-rust/nix/pull/739 ) )
25+ - Added nix::sys::ptrace::detach.
26+ ([ #749 ] ( https://github.com/nix-rust/nix/pull/749 ) )
2527
2628### Changed
2729- Renamed existing ` ptrace ` wrappers to encourage namespacing ([ #692 ] ( https://github.com/nix-rust/nix/pull/692 ) )
Original file line number Diff line number Diff line change @@ -247,6 +247,20 @@ pub fn attach(pid: Pid) -> Result<()> {
247247 }
248248}
249249
250+ /// Detaches the current running process, as with `ptrace(PTRACE_DETACH, ...)`
251+ ///
252+ /// Detaches from the process specified in pid allowing it to run freely
253+ pub fn detach ( pid : Pid ) -> Result < ( ) > {
254+ unsafe {
255+ ptrace_other (
256+ Request :: PTRACE_DETACH ,
257+ pid,
258+ ptr:: null_mut ( ) ,
259+ ptr:: null_mut ( )
260+ ) . map ( |_| ( ) )
261+ }
262+ }
263+
250264/// Restart the stopped tracee process, as with `ptrace(PTRACE_CONT, ...)`
251265///
252266/// Continues the execution of the process with PID `pid`, optionally
You can’t perform that action at this time.
0 commit comments