Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site sdccsu3.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!cornell!uw-beaver!tektronix!hplabs!sdcrdcf!sdcsvax!sdccsu3!muller From: muller@sdccsu3.UUCP (Keith Muller) Newsgroups: net.news.b,net.bugs.4bsd Subject: Re: alarm() bug in 4.2 Message-ID: <2049@sdccsu3.UUCP> Date: Tue, 17-Jul-84 02:37:54 EDT Article-I.D.: sdccsu3.2049 Posted: Tue Jul 17 02:37:54 1984 Date-Received: Fri, 13-Jul-84 03:28:07 EDT References: <282@voder.UUCP> Organization: U.C. San Diego, Computer Center Lines: 20 > Fortunately, there is an easy workaround; change the previous code > to read: > > for (...) { > oldmask = sigblock(1< ... > sigblock(oldmask); > } This won't work, this will block off SIGTERM not SIGALRM. Sigblock() requires that to block off signal i the i-th bit in the mask must be set. (The bits are numbered from 1 to n). So that line must read: oldmask = sigblock(1 << (SIGALRM - 1)); Note this easily confused with select()'s mask which does NOT need to have 1 subtracted since descriptors are numbered from 0 to n. Keith Muller UCSD Computer Center