summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/thread/id.rs
blob: 0d2fef026db76527c6309ae3331dfc4730496e97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::backend;
use crate::process::Pid;

/// `gettid()`—Returns the thread ID.
///
/// This returns the OS thread ID, which is not necessarily the same as the
/// `rust::thread::Thread::id` or the pthread ID.
///
/// # References
///  - [Linux]
///
/// [Linux]: https://man7.org/linux/man-pages/man2/gettid.2.html
#[inline]
#[must_use]
pub fn gettid() -> Pid {
    backend::thread::syscalls::gettid()
}