SHMOP (SYSV)

Spencer W. Thomas thomas at utah-gr.UUCP
Sun Nov 3 08:25:46 AEST 1985


In article <132000020 at hpfcls.UUCP> rml at 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 at utah-cs.ARPA)
	"When wrath runs rampage in your heart you must hold still
	 that rambunctions tongue!" - Sappho



More information about the Comp.unix.wizards mailing list