MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / try_decode_void_star

Function try_decode_void_star

src/backend/linux_raw/io/errno.rs:145–155  ·  view source on GitHub ↗
(
    raw: RetReg<Num>,
)

Source from the content-addressed store, hash-verified

143/// `*mut c_void` on success.
144#[inline]
145pub(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.

Callers 1

ret_void_starFunction · 0.85

Calls 4

is_in_rangeMethod · 0.80
decode_error_codeMethod · 0.80
decode_void_starMethod · 0.80
ErrnoClass · 0.70

Tested by

no test coverage detected