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 {
152152 Ok ( ( ) )
153153 }
154154
155+ pub fn send_signal ( & mut self ) -> io:: Result < ( ) > {
156+ // Fuchsia doesn't have a direct equivalent for signals
157+ unimplemented ! ( )
158+ }
159+
155160 pub fn wait ( & mut self ) -> io:: Result < ExitStatus > {
156161 let mut proc_info: zx_info_process_t = Default :: default ( ) ;
157162 let mut actual: size_t = 0 ;
Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ impl Process {
4444 unsupported ( )
4545 }
4646
47+ pub fn send_signal ( & mut self ) -> io:: Result < ( ) > {
48+ unsupported ( )
49+ }
50+
4751 pub fn wait ( & mut self ) -> io:: Result < ExitStatus > {
4852 unsupported ( )
4953 }
Original file line number Diff line number Diff line change @@ -147,13 +147,17 @@ impl Process {
147147 }
148148
149149 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 < ( ) > {
150154 // If we've already waited on this process then the pid can be recycled
151155 // and used for another process, and we probably shouldn't be killing
152156 // random processes, so return Ok because the process has exited already.
153157 if self . status . is_some ( ) {
154158 Ok ( ( ) )
155159 } else {
156- cvt ( unsafe { libc:: kill ( self . pid , libc :: SIGKILL ) } ) . map ( drop)
160+ cvt ( unsafe { libc:: kill ( self . pid , signal ) } ) . map ( drop)
157161 }
158162 }
159163
You can’t perform that action at this time.
0 commit comments