Q re Fedora (5,7) RS232 serial RxD timeouts namely c_cc[VMIN] c_cc[VTIME] and open(.... O_NONBLOCK O_NDELAY);
Jeff Perkins
jnp370 at attglobal.net
Sat May 3 10:27:28 UTC 2008
Hello Fedora-list,
I am having an issue implementing timeouts on read() to a RS232 serial line /dev/ttySx on both Fedora 5 and Fedora 7.
No sorry I don't yet have Fedora 8 or 9. Iv'e tried on multiple machines and multiple types of serial card. Same result.
As I am a Fedora novice/dunce, though an OS/2 ace, I'm hoping someone will take pity on my erroneous life choice to a dead end.
As far as I can so far tell, the titled flag bits of 'termios' and 'open' do not function as advertised (non-canonical mode). In my
instant case I issue a write of 8 bytes which correctly Tx out on the interface. Then I issue a read to get a reply (49 bytes from
remote system). I experience the following behaviour:-
open without O_NDELAY:- VMIN=50, VTIME=50 read completes OK with correct 49 bytes of data.
open without O_NDELAY:- VMIN=49, VTIME=50 OK same as above
open without O_NDELAY:- VMIN=48, VTIME=50 hangs infinitely even though sniffer shows correct 49 byte response.
open without O_NDELAY:- VMIN=0, VTIME=50 hangs infinitely even though sniffer shows correct 49 byte response.
open with O_NDELAY gets immediate negative completion of read, with perror displaying "Resource temporarily unavailable"
open with O_NONBLOCK gets same as O_NDELAY (probably same bit POSIX vs non-POSIX).
It looks like a bug to me unless there are some undocumented prerequisite/un-requisite flag bits I've omitted setting or clearing.
Does anybody have an example of a non-canonical read from a RS232 serial port which actually *will* timeout under Fedora 7?
Thanks,
JeffP ... the OS/2 waif.
More information about the fedora-list
mailing list