python - How select.select() works?

后端 未结 2 587
执笔经年
执笔经年 2021-01-30 13:50

Background:

I\'m familiar with C\'s select() function. I\'ve been using this function for many purposes. Most of them, if not all, for reading and writing

2条回答
  •  感动是毒
    2021-01-30 14:47

    Can I ask a stupid question - are you sure there are really 8 bytes left?

    Device nodes don't necessarily behave like normal files. It might be that you have to read the entire struct input_event in a single read() system call. (And if you don't read enough, the rest gets thrown away). A bit like recvmsg() on datagram sockets.

提交回复
热议问题