From owner-freebsd-bugs Sat Oct 13 12: 0:21 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 5D1CD37B411 for ; Sat, 13 Oct 2001 12:00:06 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9DJ06K91607; Sat, 13 Oct 2001 12:00:06 -0700 (PDT) (envelope-from gnats) Received: from milliways.chance.ru (milliways.chance.ru [195.190.107.35]) by hub.freebsd.org (Postfix) with ESMTP id 9A95837B401 for ; Sat, 13 Oct 2001 11:55:53 -0700 (PDT) Received: from do-labs.spb.ru (ppp-4.chance.ru [195.190.107.7]) by milliways.chance.ru (8.9.0/8.9.0) with SMTP id WAA04128 for ; Sat, 13 Oct 2001 22:55:45 +0400 (MSD) Received: (qmail 7153 invoked by uid 0); 13 Oct 2001 22:56:59 -0000 Message-Id: <20011013225659.7152.qmail@do-labs.spb.ru> Date: 13 Oct 2001 22:56:59 -0000 From: root@do-labs.spb.ru Reply-To: root@do-labs.spb.ru To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: kern/31255: select with zero timeout returns 0 even when data pending Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 31255 >Category: kern >Synopsis: select with zero timeout returns 0 even when data pending >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Oct 13 12:00:06 PDT 2001 >Closed-Date: >Last-Modified: >Originator: dozen@osw.com.ru >Release: FreeBSD 4.3-RELEASE-p20 i386 >Organization: >Environment: System: FreeBSD eix.do-labs.spb.ru 4.3-RELEASE-p20 FreeBSD 4.3-RELEASE-p20 #1: Fri Oct 12 22:18:27 GMT 2001 root@eix.do-labs.spb.ru:/usr/src/sys/compile/EIX i386 >Description: struct timeval tv = { 0,0 }; rc = select(...,&tv); This code will always return zero even if data is pending one any descriptor or any descriptor is ready to write. This is because check for timed out performed before asking kernel about descriptor state. Single Unix Spec do not states exactly that zero timeout shall lead to immediate return with correct descriptor number as result, but it looks like it is supposed to be as such. >How-To-Repeat: >Fix: The problem code is in /usr/src/sys/kern/sys_generic.c >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message