(
raw: RetReg<Num>,
)
| 115 | /// `c::c_uint` on success. |
| 116 | #[inline] |
| 117 | pub(in crate::backend) fn try_decode_c_uint<Num: RetNumber>( |
| 118 | raw: RetReg<Num>, |
| 119 | ) -> io::Result<c::c_uint> { |
| 120 | if raw.is_in_range(-4095..0) { |
| 121 | // SAFETY: `raw` must be in `-4095..0`, and we just checked that raw is |
| 122 | // in that range. |
| 123 | return Err(unsafe { Errno(raw.decode_error_code()) }); |
| 124 | } |
| 125 | |
| 126 | Ok(raw.decode_c_uint()) |
| 127 | } |
| 128 | |
| 129 | /// Check for an error from the result of a syscall which encodes a `usize` on |
| 130 | /// success. |
no test coverage detected