mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
docs: add Safety section to unsafe functions
This step was done manually by searching for "unsafe fn" in the code base and adding corresponding Safety sections. `clippy::missing_safety_doc` only works for public functions but none of the corresponding functions is public. Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
committed by
Bo Chen
parent
a9d6807522
commit
c3a809696a
@@ -22,6 +22,16 @@ pub struct clone_args {
|
||||
pub cgroup: u64,
|
||||
}
|
||||
|
||||
/// # Safety
|
||||
/// `size` must have the proper size to match `args`.
|
||||
/// Further, the caller needs to check the return value.
|
||||
///
|
||||
/// # Return
|
||||
/// - On success:
|
||||
/// - Parent: child PID (`c_long`)
|
||||
/// - Child: `0`
|
||||
/// - On error: `-1` and `errno` is set
|
||||
#[must_use]
|
||||
pub unsafe fn clone3(args: &mut clone_args, size: size_t) -> c_long {
|
||||
syscall(SYS_clone3, args, size)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user