These two simple programs simply return 0, or 1 as an exit status when run. This is probably the only case in a UNIX system where you will see 1 denoting a success.
Once compiled, these programs end up being about 8.3 kb on my system, which is almost a third the size of the GNU versions, how this happened, I have no idea; they are in essence the simplest programs in the world:
/**
* true - Probably the simplest program in the world, does nothing, and
* succeeds at it. Not very realistic, I know, but this is UNIX after
* all, not the real world where not doing anything makes you a failure.
*
* Copyright 2011-12-23 Joseph Lewis <joehms22@gmail.com>
*/
int main()
{
return 0;
}
/**
* false
* Probably the (second) simplest program in the world, does nothing,
* and fails at it. Note that this is the second because "true" is the
* first.
*
* Copyright 2011-12-23 Joseph Lewis <joehms22@gmail.com>
*/
int main()
{
return 1; // FAIL
}
No comments:
Post a Comment