From owner-freebsd-hackers Thu Apr 25 21:48:18 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id VAA08225 for hackers-outgoing; Thu, 25 Apr 1996 21:48:18 -0700 (PDT) Received: from ref.tfs.com (ref.tfs.com [140.145.254.251]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id VAA08218 for ; Thu, 25 Apr 1996 21:48:14 -0700 (PDT) Received: (from julian@localhost) by ref.tfs.com (8.7.3/8.6.9) id LAA25761; Thu, 25 Apr 1996 11:02:29 -0700 (PDT) Message-Id: <199604251802.LAA25761@ref.tfs.com> Subject: Re: Flaws in system() implementation? To: bde@zeta.org.au (Bruce Evans) Date: Thu, 25 Apr 1996 11:02:28 -0700 (PDT) From: "JULIAN Elischer" Cc: jraynard@dial.pipex.com, hackers@freebsd.org In-Reply-To: <199604250044.KAA29532@godzilla.zeta.org.au> from "Bruce Evans" at Apr 25, 96 10:44:43 am X-Mailer: ELM [version 2.4 PL25 ME8b] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > > > >> > 1. Use of a wait union when an int would do. > >> This is the correct POSIX thing to do.. > >> check the man page for wait. > > >According to the 2.1.0-RELEASE man page, wait and friends use an int* > >for the status variable. > > That is the correct POSIX thing. I stand corrected LIBRARY Standard C Library (libc.a) SYNOPSIS #include #include pid_t wait( int *status_location); pid_t waitpid( pid_t process_id, int *status_location, int options); > > >> > 3. Returns 0 if fork() fails, when -1 seems more appropriate. > >> POSIX says: > > >Thanks for posting this, I don't have access to any POSIX specs > >(except the odd snippet in books). What's the best way of getting hold > >of them? > > Joerg said that the draft POSIX spec is on the (old) WC Internet Info > cdrom. I haven't got it. I have actually only got the x/open XPG4 spec which says that it is POSIX2 compliant > > It's less ambiguous than julianese :-). It completely specifies the gee thanks :) I copied it word for word from XPG4 > 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. > > Bruce >