From owner-freebsd-hackers Fri Apr 26 17:47:22 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id RAA14751 for hackers-outgoing; Fri, 26 Apr 1996 17:47:22 -0700 (PDT) Received: from vent.pipex.net (root@vent.pipex.net [158.43.128.5]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id RAA14737 for ; Fri, 26 Apr 1996 17:47:20 -0700 (PDT) Received: from dial.pipex.com by vent.pipex.net (8.6.12/PIPEX simple 1.20) id BAA05937; Sat, 27 Apr 1996 01:46:54 +0100 Received: (from jraynard@localhost) by dial.pipex.com (8.6.12/8.6.12) id AAA01874; Sat, 27 Apr 1996 00:04:01 GMT Date: Sat, 27 Apr 1996 00:04:01 GMT From: James Raynard Message-Id: <199604270004.AAA01874@dial.pipex.com> To: bde@zeta.org.au CC: julian@ref.tfs.com, hackers@freebsd.org In-reply-to: <199604250044.KAA29532@godzilla.zeta.org.au> (message from Bruce Evans on Thu, 25 Apr 1996 10:44:43 +1000) Subject: Re: Flaws in system() implementation? Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > >> 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