pub fn getpid() -> pid_t
This bypasses libc’s caching getpid(2) wrapper which can be invalid if a raw clone was used elsewhere.
libc
getpid(2)