I am writing an application on Ubuntu Linux in C ++ to read data from a serial port. It works successfully with my code calling select()
and then ioctl(fd,FIONREAD,&bytes_avail)
to find out how many bytes are available until the data is finally received using read()
.
My question is this: every time select
returns with data, the number of bytes available is reported as 8. I assume that this is the size of the buffer that is set somewhere, and this choice returns a notification to the user when this buffer is full.
I am new to Linux as a developer (but not new to C ++), and I tried to investigate (without success) if you can resize this buffer or really if my assumptions are correct. In my application, time is critical, and I need to get warnings when there is a new byte in the read buffer. Is this possible without delving into the kernel code?
source share