File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
library/std/src/sys/process/unix Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,11 @@ impl Process {
152
152
Ok ( ( ) )
153
153
}
154
154
155
+ pub fn send_signal ( & mut self , _signal : i32 ) -> io:: Result < ( ) > {
156
+ // Fuchsia doesn't have a direct equivalent for signals
157
+ unimplemented ! ( )
158
+ }
159
+
155
160
pub fn wait ( & mut self ) -> io:: Result < ExitStatus > {
156
161
let mut proc_info: zx_info_process_t = Default :: default ( ) ;
157
162
let mut actual: size_t = 0 ;
Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ impl Process {
44
44
unsupported ( )
45
45
}
46
46
47
+ pub fn send_signal ( & mut self , _signal : i32 ) -> io:: Result < ( ) > {
48
+ unsupported ( )
49
+ }
50
+
47
51
pub fn wait ( & mut self ) -> io:: Result < ExitStatus > {
48
52
unsupported ( )
49
53
}
Original file line number Diff line number Diff line change @@ -147,13 +147,17 @@ impl Process {
147
147
}
148
148
149
149
pub fn kill ( & mut self ) -> io:: Result < ( ) > {
150
+ self . send_signal ( libc:: SIGKILL )
151
+ }
152
+
153
+ pub fn send_signal ( & mut self , signal : i32 ) -> io:: Result < ( ) > {
150
154
// If we've already waited on this process then the pid can be recycled
151
155
// and used for another process, and we probably shouldn't be killing
152
156
// random processes, so return Ok because the process has exited already.
153
157
if self . status . is_some ( ) {
154
158
Ok ( ( ) )
155
159
} else {
156
- cvt ( unsafe { libc:: kill ( self . pid , libc :: SIGKILL ) } ) . map ( drop)
160
+ cvt ( unsafe { libc:: kill ( self . pid , signal ) } ) . map ( drop)
157
161
}
158
162
}
159
163
You can’t perform that action at this time.
0 commit comments