Query buffer with serial port /dev/ttyS0
Hi all, I'm now trying to query what the size of the buffer is without actually reading it. I currently write to /dev/ttyS0 then query and then read the data. I'm just writing ABC and then receiving the same thing when I read, but the value I get when I query is something like 766 bytes (or something weird like that).
This is my call:
ioctl(num, FIONREAD, &bytes_available);
I've also tried I_NREAD instead of FIONREAD, but I'm not sure what is going on. Is the value of 766 what I should be getting for the number of bytes??