[comp.std.c] system

ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) (07/01/90)

The system() function is in ANSI C.  How long can its argument be?
How can a conforming program find out?

-- 
Science is all about asking the right questions.  | ok@goanna.cs.rmit.oz.au
I'm afraid you just asked one of the wrong ones.  | (quote from Playfair)

steve@taumet.com (Stephen Clamage) (07/02/90)

In article <3346@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
>The system() function is in ANSI C.  How long can its argument be?
>How can a conforming program find out?

The standard says:

"If the argument is not a null pointer, the _system_ function returns
an implementation-defined value."

IMHO, this means that the implementor must document any limitations on
string length, if only implicitly.  Can your program portably find out at
run-time how long a string may be?  No.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com