(raw: RetReg<Num>)
| 130 | /// success. |
| 131 | #[inline] |
| 132 | pub(in crate::backend) fn try_decode_usize<Num: RetNumber>(raw: RetReg<Num>) -> io::Result<usize> { |
| 133 | if raw.is_in_range(-4095..0) { |
| 134 | // SAFETY: `raw` must be in `-4095..0`, and we just checked that raw is |
| 135 | // in that range. |
| 136 | return Err(unsafe { Errno(raw.decode_error_code()) }); |
| 137 | } |
| 138 | |
| 139 | Ok(raw.decode_usize()) |
| 140 | } |
| 141 | |
| 142 | /// Check for an error from the result of a syscall which encodes a |
| 143 | /// `*mut c_void` on success. |
no test coverage detected