@@ -142,39 +142,39 @@ impl WaitIdStatus {
142142 /// Returns whether the process is currently stopped.
143143 #[ inline]
144144 pub fn stopped ( & self ) -> bool {
145- self . si_code ( ) == backend:: c:: CLD_STOPPED
145+ self . raw_code ( ) == bitcast ! ( backend:: c:: CLD_STOPPED )
146146 }
147147
148148 /// Returns whether the process is currently trapped.
149149 #[ inline]
150150 pub fn trapped ( & self ) -> bool {
151- self . si_code ( ) == backend:: c:: CLD_TRAPPED
151+ self . raw_code ( ) == bitcast ! ( backend:: c:: CLD_TRAPPED )
152152 }
153153
154154 /// Returns whether the process has exited normally.
155155 #[ inline]
156156 pub fn exited ( & self ) -> bool {
157- self . si_code ( ) == backend:: c:: CLD_EXITED
157+ self . raw_code ( ) == bitcast ! ( backend:: c:: CLD_EXITED )
158158 }
159159
160160 /// Returns whether the process was terminated by a signal and did not
161161 /// create a core file.
162162 #[ inline]
163163 pub fn killed ( & self ) -> bool {
164- self . si_code ( ) == backend:: c:: CLD_KILLED
164+ self . raw_code ( ) == bitcast ! ( backend:: c:: CLD_KILLED )
165165 }
166166
167167 /// Returns whether the process was terminated by a signal and did create a
168168 /// core file.
169169 #[ inline]
170170 pub fn dumped ( & self ) -> bool {
171- self . si_code ( ) == backend:: c:: CLD_DUMPED
171+ self . raw_code ( ) == bitcast ! ( backend:: c:: CLD_DUMPED )
172172 }
173173
174174 /// Returns whether the process has continued from a job control stop.
175175 #[ inline]
176176 pub fn continued ( & self ) -> bool {
177- self . si_code ( ) == backend:: c:: CLD_CONTINUED
177+ self . raw_code ( ) == bitcast ! ( backend:: c:: CLD_CONTINUED )
178178 }
179179
180180 /// Returns the number of the signal that stopped the process, if the
@@ -225,19 +225,45 @@ impl WaitIdStatus {
225225 }
226226 }
227227
228+ /// Return the raw `si_signo` value returned from `waitid`.
228229 #[ cfg( linux_raw) ]
229- fn si_code ( & self ) -> u32 {
230- self . 0 . si_code ( ) as u32 // CLD_ consts are unsigned
230+ pub fn raw_signo ( & self ) -> crate :: ffi :: c_int {
231+ self . 0 . si_signo ( )
231232 }
232233
234+ /// Return the raw `si_signo` value returned from `waitid`.
233235 #[ cfg( not( linux_raw) ) ]
234- fn si_code ( & self ) -> backend:: c:: c_int {
236+ pub fn raw_signo ( & self ) -> crate :: ffi:: c_int {
237+ self . 0 . si_signo
238+ }
239+
240+ /// Return the raw `si_errno` value returned from `waitid`.
241+ #[ cfg( linux_raw) ]
242+ pub fn raw_errno ( & self ) -> crate :: ffi:: c_int {
243+ self . 0 . si_errno ( )
244+ }
245+
246+ /// Return the raw `si_errno` value returned from `waitid`.
247+ #[ cfg( not( linux_raw) ) ]
248+ pub fn raw_errno ( & self ) -> crate :: ffi:: c_int {
249+ self . 0 . si_errno
250+ }
251+
252+ /// Return the raw `si_code` value returned from `waitid`.
253+ #[ cfg( linux_raw) ]
254+ pub fn raw_code ( & self ) -> crate :: ffi:: c_int {
255+ self . 0 . si_code ( )
256+ }
257+
258+ /// Return the raw `si_code` value returned from `waitid`.
259+ #[ cfg( not( linux_raw) ) ]
260+ pub fn raw_code ( & self ) -> crate :: ffi:: c_int {
235261 self . 0 . si_code
236262 }
237263
238264 #[ cfg( not( any( target_os = "emscripten" , target_os = "fuchsia" , target_os = "netbsd" ) ) ) ]
239265 #[ allow( unsafe_code) ]
240- fn si_status ( & self ) -> backend :: c :: c_int {
266+ fn si_status ( & self ) -> crate :: ffi :: c_int {
241267 // SAFETY: POSIX [specifies] that the `siginfo_t` returned by a
242268 // `waitid` call always has a valid `si_status` value.
243269 //
0 commit comments