This is a completely standalone sleep implementation for x86_64 Linux that depends only on the Linux kernel.
I made it for my YouTube video which you can find here:
https://www.youtube.com/watch?v=IbibjkI1kIs
Sources:
System V Application Binary Interface
License: either MIT or Public Domain, whichever you prefer.
Build:
rustc -o sleep_rs ./sleep.rs --edition=2024 -Copt-level=3 -Clink-arg=-nostartfiles -Cpanic=abort -Cstrip=debuginfo
gcc -o sleep_c -O3 -nolibc -fno-stack-protector -nostartfiles sleep.c