I have a C program which returns an integer value. I was surprised to find out that when examining the return value from the shell prompt I get the value modulo 256.
/* prog.c */
int main(...) { return 257; }
--
> ./prog.e
> echo $?
1
When a program exits, it can return to the parent process a small amount of information about the cause of termination, using the exit status. This is a value between 0 and 255 that the exiting process passes as an argument to exit.
http://www.gnu.org/s/hello/manual/libc/Exit-Status.html
alternatively:
http://en.wikipedia.org/wiki/Exit_status
came from "posix return codes" and "c return codes" respective Google searches.