(
raw: RetReg<Num>,
)
| 143 | /// `*mut c_void` on success. |
| 144 | #[inline] |
| 145 | pub(in crate::backend) fn try_decode_void_star<Num: RetNumber>( |
| 146 | raw: RetReg<Num>, |
| 147 | ) -> io::Result<*mut c::c_void> { |
| 148 | if raw.is_in_range(-4095..0) { |
| 149 | // SAFETY: `raw` must be in `-4095..0`, and we just checked that raw is |
| 150 | // in that range. |
| 151 | return Err(unsafe { Errno(raw.decode_error_code()) }); |
| 152 | } |
| 153 | |
| 154 | Ok(raw.decode_void_star()) |
| 155 | } |
| 156 | |
| 157 | /// Check for an error from the result of a syscall which encodes a |
| 158 | /// `u64` on success. |
no test coverage detected