Struct clone3::Clone3

source ·
pub struct Clone3<'a> { /* private fields */ }
Expand description

High level wrapper around the clone3 system call.

Construct it with Clone3::default() which sets no flags and no exit signal. Use builder methods to customize the underlying CloneArgs. Perform the system call with call.

Implementations§

Performs the system call.

Errors

Errors if the system call returns -1.

Panics

Panics if the set flags are incompatible:

  • CHILD_CLEARTID and CHILD_SETTID must not be set together
  • CLEAR_SIGHAND and SIGHAND must not be set together
  • NEWIPC and SYSVSEM must not be set together
  • FS and NEWNS must not be set together
  • THREAD and PIDFD must not be set together
  • NEWPID must not be set with PARENT or THREAD
  • NEWUSER must not be set with FS or PARENT or THREAD
  • if SIGHAND is set then VM must be set
  • if THREAD is set then SIGHAND must be set

Panics if the system call returns a value that neither indicates failure nor is convertible to pid_t which could happen on overflow due to different type sizes. This is a bug in the Linux kernel or the libc bindings used by this crate.

Performs the system call.

Like call but never errors or panics. Forwards the return value of the system call.

Returns the underlying CloneArgs.

Prefer using call instead. If you manually perform the system call you must ensure that the referenced variables stay alive and the referenced mutable variables are not aliased.

Trait Implementations§

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.