The reason this is not in the .h limit is because it is not a quantity giving the limits of the range of integral type values based on the bit width in the current architecture. This is the role assigned by limit.h to the ISO standard.
The value that interests you is not related to equipment in practice and may vary from platform to platform and, possibly, to assemble a system for assembling the system.
The right thing is to call sysconf and request it for "ARG_MAX" or "_POSIX_ARG_MAX". I think a POSIX-compatible solution anyway.
Acc. to my documentation, you include one or both of unistd.h or limits.h based on the values you request.
Another point: many implementations of the exec family of functions return E2BIG or a similar value if you try to call them with a negative environment. This is one of the specific conditions under which exec can indeed return.
Thomas Kammeyer
source share