Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jan 97 23:09:26 +0000
From:      Andrew.Gordon@net-tel.co.uk
To:        brandon@cold.org
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: select() on a serial device--ignoring OS buffered chars?
Message-ID:  <"45f6-970114221805-5E50*/G=Andrew/S=Gordon/O=NET-TEL Computer Systems Ltd/PRMD=NET-TEL/ADMD=Gold 400/C=GB/"@MHS>
In-Reply-To: <Pine.NEB.3.95.970114104018.3232A-100000@cold.org>

next in thread | previous in thread | raw e-mail | index | archive | help
>         scount = select(1, &read_fds, NULL, NULL, &tv);
                         ^^^
                         This looks like the problem to me.

The select() manpage is a little confusing - that first parameter is the
number of bits in the mask that get inspected, not the number of
active fds ('1' bits).  See selscan() in /sys/kern/sys_generic.c

So unless your FD happens to be zero, this call isn't going to do
anything useful.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?"45f6-970114221805-5E50*/G=Andrew/S=Gordon/O=NET-TEL Computer Systems Ltd/PRMD=NET-TEL/ADMD=Gold 400/C=GB/">