Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!utgpu!water!watmath!clyde!ima!haddock!karl
From: karl@haddock.UUCP
Newsgroups: comp.lang.c
Subject: return values and errno
Message-ID: <1853@haddock.ISC.COM>
Date: Thu, 3-Dec-87 15:42:25 EST
Article-I.D.: haddock.1853
Posted: Thu Dec  3 15:42:25 1987
Date-Received: Sun, 6-Dec-87 16:52:36 EST
References: <10224@brl-adm.ARPA> <9272@mimsy.UUCP> <1804@geac.UUCP> <1761@haddock.ISC.COM> <244@papaya.bbn.com>
Reply-To: karl@haddock.ima.isc.com (Karl Heuer)
Organization: Interactive Systems, Boston
Lines: 10

I wrote:
>  errno = 0;
>  unlink(fname);
>  if (errno != 0) abort();
and was informed that this is unportable usage because the POSIX spec doesn't
guarantee that functions will preserve errno on success.

Tell me then, o POSIX gurus, whether there are still functions that can return
-1 on success (e.g. ptrace() and possibly nice())?  If so, does POSIX specify
what these functions are allowed to do with errno in such a case?