Date: Sat, 27 Apr 1996 00:04:01 GMT From: James Raynard <jraynard@dial.pipex.com> To: bde@zeta.org.au Cc: julian@ref.tfs.com, hackers@freebsd.org Subject: Re: Flaws in system() implementation? Message-ID: <199604270004.AAA01874@dial.pipex.com> In-Reply-To: <199604250044.KAA29532@godzilla.zeta.org.au> (message from Bruce Evans on Thu, 25 Apr 1996 10:44:43 %2B1000)
next in thread | previous in thread | raw e-mail | index | archive | help
> >> If "command" is a null pointer, the system() function returns non-zero > >> only if a command processor is available. > > >OK (Out of interest, what kind of circumstances would result in a > >command processor not being available?) > > Non-POSIX ones. system((char *)NULL) is about the only aspect of system() > that is specified by ANSI. It returns 0 to tell you that system() is > completely useless on the current system :-). I see. 8-) > >> If a child process cannot be created, > >> or if the termination status of hte command interpretter cannot be obtained > >> system() returns -1 > >> and sets errno to indicate the error. > > >Doesn't that imply that system() should return -1 if fork() fails? > >(Forgive me if I'm being obtuse, I'm not very experienced at reading > >standardese). > > It's less ambiguous than julianese :-). It completely specifies the > return value after a fork failure, at least in my copy, which says > "shall return -1" instead of "returns -1". "shall" is standardese that > means that the implementation is non-conforming if it does anything > else. "should" would allow the implementation to screw up. OK, that was what I thought it meant - I was using "should" with its colloquial meaning rather than the standardese meaning (I did warn you I wasn't very experienced at this 8-) Thanks for answering all my questions, James -- James Raynard, Edinburgh, Scotland mail: jraynard@dial.pipex.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199604270004.AAA01874>