(
raw: RetReg<Num>,
)
| 100 | /// `c::c_int` on success. |
| 101 | #[inline] |
| 102 | pub(in crate::backend) fn try_decode_c_int<Num: RetNumber>( |
| 103 | raw: RetReg<Num>, |
| 104 | ) -> io::Result<c::c_int> { |
| 105 | if raw.is_in_range(-4095..0) { |
| 106 | // SAFETY: `raw` must be in `-4095..0`, and we just checked that raw is |
| 107 | // in that range. |
| 108 | return Err(unsafe { Errno(raw.decode_error_code()) }); |
| 109 | } |
| 110 | |
| 111 | Ok(raw.decode_c_int()) |
| 112 | } |
| 113 | |
| 114 | /// Check for an error from the result of a syscall which encodes a |
| 115 | /// `c::c_uint` on success. |
no test coverage detected