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
- Why don't I see the whole integer?
- Where is this behavior documented?
- How can I get the whole 32-bit value to the shell?