Mail Archives: djgpp/1998/04/09/06:26:46
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.
- Raw text -