Expand description
Convert values to ArgReg and from RetReg.
System call arguments and return values are all communicated with inline
asm and FFI as *mut Opaque. To protect these raw pointers from escaping
or being accidentally misused as they travel through the code, we wrap them
in ArgReg and RetReg structs. This file provides From
implementations and explicit conversion functions for converting values
into and out of these wrapper structs.
Β§Safety
Some of this code is unsafe in order to work with raw file descriptors,
and some is unsafe to interpret the values in a RetReg.
ModulesΒ§
- fs π
 
FunctionsΒ§
- by_mut π
 - by_ref π
 - c_int π
 - Convert a 
c_intinto anArgReg. - c_uint π
 - Convert a 
c_uintinto anArgReg. - dev_t π
 - loff_t π
 - loff_
t_ πfrom_ u64  - negative_
pid π - no_fd π
 - Deliberately pass 
-1to a file-descriptor argument, for system calls likemmapwhere this indicates the argument is omitted. - opt_mut π
 - Convert an optional mutable reference into a 
usizefor passing to a syscall. - opt_ref π
 - Convert an optional immutable reference into a 
usizefor passing to a syscall. - pass_
usize π - Pass an arbitrary 
usizevalue. - raw_fd π β
 - Pass a raw file-descriptor argument. Most users should use 
ArgReg::frominstead, to preserve I/O safety as long as possible. - ret π β
 - Convert a 
usizereturned from a syscall that effectively returns()on success. - ret_
c_ πint  - Convert a 
usizereturned from a syscall that effectively returns ac_inton success. - ret_
c_ π βint_ infallible  - Convert a 
c_intreturned from a syscall that effectively always returns ac_int. - ret_
c_ πuint  - Convert a 
usizereturned from a syscall that effectively returns ac_uinton success. - ret_
c_ π βuint_ infallible  - Convert a 
c_uintreturned from a syscall that effectively always returns ac_uint. - ret_
discarded_ π βfd  - Convert the return value of 
dup2anddup3. - ret_
error π β - Convert a 
usizereturned from a syscall that doesnβt return on success. - ret_
infallible π β - Convert a 
usizereturned from a syscall that effectively always returns(). - ret_
owned_ π βfd  - Convert a 
usizereturned from a syscall that effectively returns anOwnedFdon success. - ret_u64 π
 - Convert a 
usizereturned from a syscall that effectively returns au64on success. - ret_
usize π - Convert a 
usizereturned from a syscall that effectively returns ausizeon success. - ret_
usize_ π βinfallible  - Convert a 
usizereturned from a syscall that effectively always returns ausize. - ret_
void_ πstar  - Convert a 
usizereturned from a syscall that effectively returns a*mut c_voidon success. - size_of π
 - Pass the 
mem::size_ofof a type. - slice π
 - slice_
just_ πaddr  - slice_
just_ πaddr_ mut  - slice_
mut π - socklen_
t π - zero π
 - Pass a zero, or null, argument.