$ cat exitcodetest.c
int main()
{
return -1;
}
$ gcc exitcodetest.c
$ ./a.out
$ echo $?
255https://unix.stackexchange.com/questions/37915/why-do-i-get-error-255-when-returning-1
UNIX/POSIX, the exit code of a program is defined to be an unsigned 8-bit value. Converting -1 to unsigned 8-bit gives 255.
http://man7.org/linux/man-pages/man2/execve.2.html
On success, execve() does not return, on error -1 is returned
めも、素敵〜