att & osf
Barry Shein
bzs at encore.UUCP
Sun Aug 21 06:10:11 AEST 1988
Henry Spencer writes...
>Well, actually, it can in various ways. To take a small example, consider
>the vile botch in System V interprocess communication of using -1 (rather
>than 0) cast to a pointer as an error return code. That is *not* portable,
>but it happens to work on certain architectures.
Far be it for me to defend anyone, but this stems from a day-one bug
that predates all of this (at least V6, probably earlier.)
Consider that sbrk() returns -1 (specifically, (char *)-1) as an error
code in all Unix's I know of (BSD, SYSV.)
Real problem of conventions, should syscalls always try to return -1?
Unfortunate convention!
-Barry Shein, ||Encore||
More information about the Comp.unix.wizards
mailing list