[lkml]   [2001]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectproblem with select() - 2.4.5

Hi !
I have a problem with reading from a serial port using select() under
2.4.5. What I am doing is basically the following:

fd_set readfds;
struct timeval timeout;
int s;

serialfd = open("/dev/ttyS0", O_RDWR );


timeout.tv_sec = 2; /* ! */
timeout.tv_usec = 0;
s=select(serialfd+1, &readfds, NULL, NULL, &timeout);

But s is always equal to 0 even when I am sure there are data to read.
If I use

s=select(serialfd+1, NULL, &writefds, NULL, &timeout);

(with the corresponding initialisation of writefds) it returns s=1 and I
can write to the serial port. I can see that since the lights of the modem
are flashing.
I noticed that behavior since I tried to send some "ATZ" with the
write-function but I never got the "OK" back.

However, the same programme works under 2.2.19.

Any help, please ?


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:55    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean