Hi all,
We have a thread that does many things, including reading frame from the PLIN device. In order not to block, we poll() the character device and then read() the frame if polling was successful.
For a LIN master with a disabled schedule table, I am not expecting poll() to return a positive number since we shouldn't be receiving any frames. On the first poll() call, it returns zero, but then on the following poll(), it returns 1. My thread thinks there is a frame, so it executes read() on the device, but then blocks because there is not frame.
I've attached an example project that poll() and read() if it is successful. And it should block on read() even thought poll() returned 1 just before.
Thanks,
Gabriel
Weird poll() behavior on the character device
-
- Posts: 6
- Joined: Fri 5. Aug 2022, 15:08
Weird poll() behavior on the character device
- Attachments
-
- plin.zip
- (4.37 KiB) Downloaded 309 times
-
- Posts: 6
- Joined: Fri 5. Aug 2022, 15:08
Re: Weird poll() behavior on the character device
I found the issue, it was caused by the way I read things in my application. The driver seems to be working as expected with the poll() interface. Thanks anyway!