File tree 2 files changed +16
-0
lines changed
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/).
22
22
([ #739 ] ( https://github.com/nix-rust/nix/pull/739 ) )
23
23
- Expose ` signalfd ` module on Android as well.
24
24
([ #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 ) )
25
27
26
28
### Changed
27
29
- 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<()> {
247
247
}
248
248
}
249
249
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
+
250
264
/// Restart the stopped tracee process, as with `ptrace(PTRACE_CONT, ...)`
251
265
///
252
266
/// Continues the execution of the process with PID `pid`, optionally
You can’t perform that action at this time.
0 commit comments