Re: Select with device and stdin not working

From: Stephen Landamore (stephenl@zeus.com)
Date: Wed Jul 25 2001 - 09:14:28 EST


> Select is working fine for device (in this example /dev/random) or
> stdin. But for both, not. When entering something to stdin, it's not
> sure select will return.

If stdin is a tty, chances are select will not show any data ready
until you hit return - this is canonical mode (or cooked mode). Try
clearing canonical mode (or setting cbreak / raw mode).

In the case of stdin being a tty, and you are typing away, note that
your keypresses will generate entropy - so /dev/random probably will
become ready to read before stdin ;)

cheers,
stephen

--
Stephen Landamore, <slandamore@zeus.com>              Zeus Technology
Tel: +44 1223 525000                      Universally Serving the Net
Fax: +44 1223 525100                              http://www.zeus.com
Zeus Technology, Zeus House, Cowley Road, Cambridge, CB4 0ZT, ENGLAND

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:22 EST