Is tcgetbuffers used only with non-blocking mode?

If I open a serial port in blocking mode
fd1 = open (“/com/0”, (O_RDWR|O_DMA));

and then later use tcgetbuffers I always get error no. 88 which is ENOSYS(function not supported) as
while(1)
{
retbuf = tcgetbuffers(fd1, &bufs);
if (retbuf < 0)
{
printf("Error no.= %d
", getErrno());
tx_thread_sleep(100);
continue;
}
}

Can tcgetbuffers not be used with blocking operations?

I never got it to work right on NetOS 6.0.

Since you are using a while() loop anyway, you could just wait calling tx_thread_sleep(1) repeatedly until tcgetbuffers() returns that there is data (bufs.rxbuf>0).

Why don’t you use:

A) blocking reads in a separate thread
or
B) non-blocking reads and check how many bytes have been read

It seems simpler to me…

My 2 cents,
PC