Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!columbia!rutgers!dayton!rosevax!sds!dave
From: dave@sds.SciCom.MN.ORG (dave schmidt x194)
Newsgroups: comp.lang.c
Subject: Re: Weird syscall returns
Message-ID: <430@sds.SciCom.MN.ORG>
Date: Wed, 15-Jul-87 15:01:35 EDT
Article-I.D.: sds.430
Posted: Wed Jul 15 15:01:35 1987
Date-Received: Sat, 18-Jul-87 03:22:40 EDT
References: <1158@copper.TEK.COM> <6858@auspyr.UUCP> <17171@cca.CCA.COM> <23189@sun.uucp>
Organization: SciCom Data Services Ltd., Minnetonka, MN
Lines: 27

> > >     I can think of no Unix system call that doesn't return -1 on error.
> > 
> > What about nice()?
> 
> From the S5R3 manual page:
> 
> 	DIAGNOSTICS
> 	     Upon successful completion, "nice" returns the new nice
> 	     value minus 20.  Otherwise, a value of -1 is returned and
> 	     "errno" is set to indicate the error.
> 
> Other versions of "nice" may just return 0 on success, but they all
> return -1 on error.

How about "all reasonable versions return -1 on error"?  Here in the
backwaters of UNIX work-a-likes (aka XENIX), the manual says

	RETURN VALUE

	On successful completion, 'nice' returns the new nice value minue
	20.  Note that 'nice' is unusual in the way return codes are 
	handled.  It differs from most other system calls in two ways: the
	value -1 is a valid return code (in the case where the new nice
	value is 19), and the system call either works or ignores the
	request; THERE IS NEVER AN ERROR.  [my emphasis]

Personally, I'd regard ignoring the request as an error, but ...