Menu

#3 Non-blocking mode does not work on some Linuxes

v1.0_(example)
open
None
1
2014-09-23
2014-09-23
Julian Gold
No

Using

fcntl(serial->fd,F_SETFL,O_ASYNC|O_NONBLOCK)

will fail because the subsequent read() call after obtaining the signal will return the error EAGAIN ("resource temporarily unavailable"). This translates to invoking read on a descriptor marked with O_NONBLOCK. Replacing the above line with

fcntl(serial->fd,F_SETFL,O_ASYNC)

should solve this issue.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.