pub fn sys_clone(
flags: u32,
stack: *const u8,
ptid: *const u32,
tls: *const usize,
ctid: *const u32
) -> isize
Expand description
Explanation of Parameters
Mainly about ptid
, tls
and ctid
:
CLONE_SETTLS
: The TLS (Thread Local Storage) descriptor is set to tls
.
CLONE_PARENT_SETTID
: Store the child thread ID at the location pointed to by ptid
in the parent’s memory.
CLONE_CHILD_SETTID
: Store the child thread ID at the location pointed to by ctid
in the child’s memory.
ptid
is also used in CLONE_PIDFD
(since Linux 5.2)
Since user programs rarely use these, we could do lazy implementation.