Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site utah-gr.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!utah-cs!utah-gr!thomas
From: thomas@utah-gr.UUCP (Spencer W. Thomas)
Newsgroups: net.unix-wizards
Subject: Re: SHMOP (SYSV)
Message-ID: <1619@utah-gr.UUCP>
Date: Sat, 2-Nov-85 17:25:46 EST
Article-I.D.: utah-gr.1619
Posted: Sat Nov  2 17:25:46 1985
Date-Received: Mon, 4-Nov-85 03:15:44 EST
References: <132000020@hpfcls.UUCP>
Reply-To: thomas@utah-gr.UUCP (Spencer W. Thomas)
Organization: Univ of Utah CS Dept
Lines: 16

In article <132000020@hpfcls.UUCP> rml@hpfcla.UUCP writes:
>From the way most UN*X implementations (including the early ones) have
>been written, *all* system calls return -1 on failure.  

Hoo boy!  Gotcha on this one.  Both the PDP-11(V6/V7) and
VAX(32V-4.3bsd) versions of Unix set the CARRY BIT to indicate error.
The actual error code is returned in r0.  Returning -1 for error is a C
LANGUAGE convention (since it's hard to test the carry bit in C).
Granted, the routine "cerror" always returns -1 on an error.  This is a
bitch when the system call can legitimately return -1.

-- 
=Spencer   ({ihnp4,decvax}!utah-cs!thomas, thomas@utah-cs.ARPA)
	"When wrath runs rampage in your heart you must hold still
	 that rambunctions tongue!" - Sappho