*BSD News Article 12420


Return to BSD News archive

Newsgroups: comp.os.386bsd.bugs
Path: sserve!manuel.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!swrinde!gatech!howland.reston.ans.net!usc!news.service.uci.edu!ucivax!ucla-cs!twinsun!eggert
From: eggert@twinsun.com (Paul Eggert)
Subject: Re: cvs 1.3 bugfix
Message-ID: <blwf{4xU@twinsun.com>
Sender: usenet@twinsun.com
Nntp-Posting-Host: farside
Organization: Twin Sun Inc, El Segundo, CA, USA
X-Newsreader: NN version 6.4.19
References: <RICH.93Mar3114046@omicron.Rice.edu> 	<SOMMERFELD.93Mar3180839@blatt.apollo.hp.com> 	<RICH.93Mar3233616@omicron.Rice.edu> 	<CGD.93Mar4170821@eden.CS.Berkeley.EDU> <blv0K2^8@twinsun.com> <RICH.93Mar6233047@omicron.Rice.edu>
Date: Sun, 7 Mar 1993 17:42:59 GMT
Lines: 30

rich@Rice.edu (Richard Murphey) writes:

>In article <blv0K2^8@twinsun.com> eggert@twinsun.com (Paul Eggert) writes:

>   Posix 3.3.3.3 says that the sigismember macro must behave as follows.

>	   IF sigismember(N,S) completes successfully
>	   THEN it yields 1 if signal N is a member of the set S, 0 otherwise
>	   ELSE it yields -1 and sets errno
>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

>???  It says '...if an error is *detected*, a value of -1 is
>returned...'  as you quoted below.  Does 'is detected' mean the same
>thing as 'occurred' here?

It doesn't matter whether the error occurs, only whether it is detected.
(In this case, the ``error'' is sigismember(N,S) where N is out of range.)
There is some implementation freedom here, namely whether to detect the error.
If the error is detected, then sigismember must yield -1 and set errno;
otherwise, sigismember must yield the correct answer, which is 0 in this case.


>Why doesn't the standard use 'occurs' here as it does in other sections
>(e.g. 5.1.2.4) rather than 'is detected'?

In some places, Posix requires that errors *must* be detected.  For example,
5.1.2.4 says that opendir() must detect and report EACCES-style errors.
(By ``report'' I mean ``yield -1 and set errno''.)  But in other places,
Posix merely says that *if* an error is detected, *then* it must be reported.
This is the case for sigismember and EINVAL-style errors.