Date: Thu, 9 Apr 1998 13:24:37 +0300 (IDT) From: Eli Zaretskii To: Will Rose cc: djgpp AT delorie DOT com Subject: Re: Executing a program and obtaining its return value In-Reply-To: <892102406.261004@optional.cts.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On 9 Apr 1998, Will Rose wrote: > Whether system() returns a valid exit code is implementation defined; That's what ANSI Standard says. However, in the case of DJGPP, the implementation-defined behavior is *always* to return the exit code of the subsidiary program. > You can certainly return a pointer, but what use would it be? Pointers > point to objects in a given processes' address space, and (with rare > exceptions) won't mean anything to another process. What would another > process do with the pointer when it had got it? And if the process > has exited, where would the pointer point to anyway? However, a parent program can meaningfully pass a pointer to a child program, provided that the child can access that portion of memory. That's how DJGPP programs pass long command lines between them.