Subject: Serial port programming problem/question
To: None <netbsd-users@netbsd.org>
From: Leif Lindholm <leif@smurfnet.nu>
List: netbsd-users
Date: 01/07/2005 15:31:14
Hi

I've been trying to port a program i wrote on Linux to NetBSD 2.0 (both
x86), but I have problems getting the serial communications working.

The program is reading input from a serial port (ttyS0/tty00), in normal
newline-terminated ASCII format (9600, 8N1).

My first problem is that the open("/dev/tty00") call never returns
unless I use O_NONBLOCK.
My second is that if I use O_NONBLOCK, the select() call always return
and the FD_ISSET() shows that there is data available - but the read()
doesn't return any data.

I get the output just fine when using minicom/kermit on the NetBSD, so
there shoudn't be anything else blocking the port.

Which serial device should I be using - tty00 or dty00 (or some other)?

Does anyone have some sample code I could use for reference?

Am I missing something obvious?

regards
	/
		Leif

p.s.
Please cc replies, as I am not subscribed to the list.
d.s.