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!usc!news.service.uci.edu!ucivax!ucla-cs!twinsun!eggert From: eggert@twinsun.com (Paul Eggert) Subject: Re: cvs 1.3 bugfix Message-ID: <blv0K2^8@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> Date: Sat, 6 Mar 1993 23:44:52 GMT Lines: 41 cgd@eden.CS.Berkeley.EDU (Chris G. Demetriou) writes: >it turns out that the macro is fine just the way it was; This is incorrect. 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 The macro was not ``fine just the way it was'', because sigismember(33, S) was yielding 1 even though 33 was not a member of the signal set S. Since 33 is not a signal number at all, it can't possibly be the member of any signal set, so (according to the above spec) sigismember(33, S) must either yield 0, or yield -1 and set errno; yielding 1 is incorrect. That being said, CVS is wrong to assume that the signal numbers start with 1 and increase by 1; but that's another story, and it's independent of the sigismember bug. Here are relevant quotes from Posix 1003.1-1990: 3.3.3.3 (when applied to sigismember) is equivalent to the IF-THEN-ELSE paraphrase quoted above. 2.4 makes it clear that ``completes successfully'' is equivalent to ``no error is detected''. 2.4 Error Numbers ... If no error condition is detected, the action requested shall be successful.... 3.3.3.3 Returns Upon successful completion, the sigismember() function returns a value of one if the specified signal is a member of a specified set, or a value of zero if it is not. Upon successful completion, the other functions return a value of zero. For all of the above functions, if an error is detected, a value of -1 is returned, and _errno_ is set to indicate the error.