Node:How long, Next:, Previous:Long commands, Up:Command line

16.5 What is the maximum length of command line under DJGPP

Q: What is the longest command line I can pass to gcc when it is invoked by Make?

A: The arguments are passed to DOS Exec call (Int 21h function 4Bh) via the transfer buffer which is 16KB-long. Apart of the command line, it is also used to pass other info, such as the !proxy parameters and the copy of the environment for the child program (let's say, less than 2000 bytes in most cases, but your mileage may vary). This leaves at least 13K bytes for arguments (including a separating blank between any two arguments). So unless your arguments span more than 160 screen lines, you shouldn't worry. However, if your environment is very large (some people need as much as 6KB to accommodate for all the variables used by the various packages installed on their machine), be sure to stub-edit the programs that spawn other programs to a larger transfer buffer, or else they could fail.

The above limit depends on the size of the transfer buffer, so check the size of the value recorded in the stub header of the parent program before you pass extremely long command lines to its children. GCC is the first program you should worry about, because the linker (ld.exe) usually gets long command lines from GCC (they include the list of all the object files and libraries to be linked).