Date: Sun, 13 Dec 1998 17:02:23 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Simone Zanella cc: djgpp AT delorie DOT com Subject: Re: DJGPP: finding command line in spawned programs In-Reply-To: <199812131425.PAA06520@mail.prometeo.it> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Sun, 13 Dec 1998, Simone Zanella wrote: > I need to find the command line with which a program is spawned; with > typical Dos executables, it is located from offset 0x80 of the PSP; but if > a DJGPP compiled executable spawns another DJGPP executable, at this > address there's a "!proxy" string followed by 3 four digits hex numbers. > How can I use them to find the command line? The command line is in the argv[] variable, as usual in C. The DJGPP startup code already does all the work for you: it finds the command line and puts it into the argv[] array. Isn't that what you want? If not, please explain why. It is not clear from your message why did you need to look in the PSP at all, even in the simple case of a program invoked from a DOS prompt. argv[] holds the command line in that case as well.