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