Date: 13 Oct 2001 22:56:59 -0000 From: root@do-labs.spb.ru To: FreeBSD-gnats-submit@freebsd.org Subject: kern/31255: select with zero timeout returns 0 even when data pending Message-ID: <20011013225659.7152.qmail@do-labs.spb.ru>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011013225659.7152.qmail>