*BSD News Article 28778


Return to BSD News archive

Xref: sserve comp.os.386bsd.bugs:2153 comp.os.386bsd.questions:9452
Newsgroups: comp.os.386bsd.bugs,comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!yeshua.marcam.com!usc!sdd.hp.com!think.com!cass.ma02.bull.com!as02.bull.oz.au!melb.bull.oz.au!zen!sjg
From: sjg@zen.void.oz.au (Simon J. Gerraty)
Subject: Re: POSIX signal handling problem? CVS-1.3
Message-ID: <1994Mar23.232435.22939@zen.void.oz.au>
Organization: Zen programming...
Date: Wed, 23 Mar 1994 23:24:35 GMT
References: <2mmh0h$dsj@sylvester.cc.utexas.edu>
Lines: 30

vax@sylvester.cc.utexas.edu (Vax) writes:
>Compiling CVS-1.3, I found that:
>1) CVS-1.3's configure utility sees the POSIX include files and assumes
>POSIX signals.

Good thing.

>2) Compiling produces no problems, but the resultant program hangs somewhere
>in SIG_register().

There is a bug... Under 386bsd at least the following loop in
SIG_init() would never terminate:

	(void) sigfillset(&sigset_test);
	for (i = 1; sigismember(&sigset_test, i) == 1; i++)
		;

A soultion is to modify the above to something like:

	for (i = 1; i < SIGMAX && sigismember(&sigset_test, i) == 1; i++)
		;

Whether it is a CVS bug or a 386bsd bug, the original code works fine
on NetBSD.  But the loop should have a definite termination criteria.

--sjg
-- 
Simon J. Gerraty        <sjg@zen.void.oz.au>

#include <disclaimer>   /* imagine something _very_ witty here */