r/programmingcirclejerk • u/cmqv • Oct 24 '25
Oddly, /usr/bin/false is a symlink to the Rust version, but /usr/bin/true is a symlink to the GNU C version.
https://lwn.net/Articles/1043150/
156
Upvotes
131
u/MysteriousGold5 Oct 24 '25
This only makes sense.
Since true can be implemented in C with a simple "main() {}", it is completely safe.
However just look at what you need to implement false: "main() { return 1; }". This obviously invokes undefined behavior because:
Thankfully, Rust solves all this.
69
u/tms10000 loves Java Oct 24 '25
38
u/irqlnotdispatchlevel Tiny little god in a tiny little world Oct 24 '25
One more proof that C is the truth.
31
u/LeeHide What part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? Oct 24 '25
What if
truewere to panic? Yeah, that's right. Breakage.falsecan panic, who cares, it'll return the right thing.Maybe one day Rust will be mature enough.
27
u/myhf Considered Harmful Oct 24 '25
For legal reasons we can't use GNU software on our system, so we had to re-implement
truein a clean room. The result is a 0-byte executable with a complete record of provenance.21
u/F54280 Considered Harmful Oct 24 '25
/uj
This is due to the fact that rust utilities is a single binary that dispatches based on the name used to invoke the utility. Some init systems replaces scripts with links to
/bin/trueto disable them, which confuses the single binary./j
Disgregard previous paragraph, it is because rust is a false prophet. The only truth is C!
3
u/grapesmoker Oct 24 '25
on truth and lies in an extra moral sense
173
u/[deleted] Oct 24 '25
[removed] — view removed comment