From owner-freebsd-hackers Tue Apr 20 8:54:57 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from lestat.nas.nasa.gov (lestat.nas.nasa.gov [129.99.50.29]) by hub.freebsd.org (Postfix) with ESMTP id D9EB914F09 for ; Tue, 20 Apr 1999 08:54:48 -0700 (PDT) (envelope-from thorpej@lestat.nas.nasa.gov) Received: from lestat (localhost [127.0.0.1]) by lestat.nas.nasa.gov (8.8.8/8.6.12) with ESMTP id IAA11637; Tue, 20 Apr 1999 08:51:57 -0700 (PDT) Message-Id: <199904201551.IAA11637@lestat.nas.nasa.gov> To: Bob Bishop Cc: Graham Wheeler , hackers@FreeBSD.ORG Subject: Re: Using select() to implement a delay Reply-To: Jason Thorpe From: Jason Thorpe Date: Tue, 20 Apr 1999 08:51:57 -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 20 Apr 1999 11:25:35 +0100 Bob Bishop wrote: > Most likely your select() is taking a signal; truss might be revealing. You > should in theory be able to write something along the lines of: > > do > r = select(0, 0, 0, 0, &tv); > while (r == -1 && errno == EINTR); > > but AFAIK tv won't get updated correctly, see the BUGS entry in select(2). What do you mean "won't get updated correctly"? A const timeval is the correct behavior :-) In NetBSD, sleep(3) uses nanosleep(2), and thus doesn't stomp on SIGALARM. -- Jason R. Thorpe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message