[TUHS] /bin/true (was basic tools / Universal Unix)

Doug McIlroy doug at cs.dartmouth.edu
Mon Oct 23 09:00:39 AEST 2017

> macOS requires you to have a data section aligned to 4K, even if you
> don't use it. The resulting binary is a little over 8K; again, mostly
> zeros.

Not quite. The classic empty executable file for /bin/true works
on OS X. That is not just a clever trick;it's a natural consequence
of Kernighan's ancient prrecept: do nothing gracefully. Conceivably
the 4K data section is, too--if the page has no physical presence
until it is accessed.


More information about the TUHS mailing list