Re: Strange problem with tty layer

From: Paul Fulghum
Date: Fri Jan 26 2007 - 10:07:06 EST


Lennart Sorensen wrote:
I am not sure actually. I just open /dev/ttyn0 and /dev/ttyn1 and write
to one, and read from the other. I didn't even know about the line
diciplines actually. How do I tell which one I am using?

ioctl(TIOCSETD/TIOCGETD) sets/returns an integer identifier
that can be compared agains the N_XXX macros. If you are
not explicitly setting this then is is probably the default N_TTY.

Also at the application level, look at tcsetattr() for setting
the termios features. Look specifically at the c_cc[VTIME] and c_cc[VMIN]
members of the termios structure. These settings control how
much data must be available before returning data to a read().
Try VTIME=0 and VMIN=1.

Since your 'missing' data is always on the tail end, maybe
VMIN is set to 64 or something.

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