nc 0.9.7

Access system calls directly
Documentation
1
2
3
4
5
6
7
8
/// Set pointer to thread ID.
///
/// Always returns the caller's thread id.
pub unsafe fn set_tid_address(tid: &mut i32) -> pid_t {
    let tid_ptr = tid as *mut i32 as usize;
    // This function is always successful.
    syscall1(SYS_SET_TID_ADDRESS, tid_ptr).unwrap_or_default() as pid_t
}