about summary refs log tree commit diff
path: root/library/std/src/sys/unix/process/process_unix.rs
diff options
context:
space:
mode:
authorDominik Stolz <d.stolz@tum.de>2021-03-25 22:46:37 +0100
committerDominik Stolz <d.stolz@tum.de>2021-08-01 09:45:00 +0200
commit12fbabd27f700a59d0e7031f0839b220c3514bcb (patch)
treee033d904569a3b5f39c3370153bf64c3e88e3013 /library/std/src/sys/unix/process/process_unix.rs
parentc3321d3eb3bdf8655993c4564ad6569c4c849b59 (diff)
downloadrust-12fbabd27f700a59d0e7031f0839b220c3514bcb.tar.gz
rust-12fbabd27f700a59d0e7031f0839b220c3514bcb.zip
Do not call getpid wrapper after fork in tests
The test calls libc::getpid() in the pre_exec hook and asserts that the returned value is different from the PID of the parent.
However, libc::getpid() returns the wrong value.
Before version 2.25, glibc caches the PID of the current process with the goal of avoiding additional syscalls.
The cached value is only updated when the wrapper functions for fork or clone are called.
In PR #81825 we switch to directly using the clone3 syscall.
Thus, the cache is not updated and getpid returns the PID of the parent.
source: https://man7.org/linux/man-pages/man2/getpid.2.html#NOTES
Diffstat (limited to 'library/std/src/sys/unix/process/process_unix.rs')
0 files changed, 0 insertions, 0 deletions