I return an error code if my program was abnormally terminated (via exit ()). For standard situations, I just return a basic error (e.g. ENOMEM for broken mallocs, etc.). However, there are also cases where I will have to stop working for my own reasons for which system errnos are not defined.
What error values โโshould I return so that they do not collide with existing ones. Or am I doing all this in return?
edit: I'm sorry if I did not understand the question. I am not talking about listing, etc. (This is a mechanism for determining error codes). I talked about the range of values โโthat they could accept without encountering standard ones.
I did not know that a program can only return 8-bit statuses. Therefore, it seems that @r is true - it is too small to contain, perhaps even all the standard ones, not to mention my user errors. so 1/0 is :)
Manav source
share