The explanation is right at the top of man exit
:
The exit() function causes normal process termination and the value of
status & 0377 is returned to the parent (see wait(2)).
In other words, only the lowest 8 bits are propagated to the parent process.
In this respect, returning the exit code from main()
is no different to passing it to exit()
.