Re: [SLUG] select() on a serial port

From: Dylan William Hardison (dylan@hardison.net)
Date: Thu Jun 29 2006 - 08:17:43 EDT


Spake Bill Glidden on Wednesday, June 28, 2006 at 11:53PM -0400:
> I'm trying, in vain, to get the select() call to work on a serial port I've
> opened. I need this program to poll the serial port for input occasionally,
> but select() doesn't seem to do the trick for me here. It just times out.
>
> Are there any specific tricks to getting select() to work on a serial port?
>

I'm not sure select() works with serial ports... I seem to remember
async serial ports needing the program to trap SIGIO and do some other weird
stuff.

Anyway, libevent [1] is a wrapper around (e)poll, select() and other
asynchronous I/O functions. It chooses the best one available, and does
support serial ports. If there is any black magic for serial ports +
select(), I would expect its source code to have it.

[1] http://www.monkey.org/~provos/libevent/

-- 
"And she sang A-litta-doo-de-litta-doo-da-litta-doo-da-dee 
 She-hiddle-dum-adee-she-hiddle-dum-a-dee and she-landae"
-
GPG Fingerprint: E3CD FDAB 82C4 14FD 7B57  430B 770E 0EAF FB53 12C2
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:18:27 EDT