Robert Bachmann wrote:
Sara Shoemaker wrote:
Hi all -
I am trying to launch a web browser from within my code for Linux. The
problem is that I am getting no failure code back when the browser
doesn't launch. (I'm trying to force a failure case so I can test the
alert dialog, so I am trying to launch a browser that I know doesn't
exist on my machine).
Your question is off-topic in comp.lang.c
Please try asking in an Linux specific newsgroup.
To be a little more expansive, the reason why the question is
best asked elsewhere is that the C standard guarantees very
little about the system() function. Here is what the current
C standard says:
<quote>
#include <stdlib.h>
int system(const char *string);
If string is a null pointer, the system function determines
whether the host environment has a command processor. If
string is not a null pointer, the system function passes
the string pointed to by string to that command processor
to be executed in a manner which the implementation shall
document; this might then cause the program calling system
to behave in a non-conforming manner or to terminate.
If the argument is a null pointer, the system function
returns nonzero only if a command processor is available.
If the argument is not a null pointer, and the system function
does return, it returns an implementation-defined value.
</quote>
Allin Cottrell