Question regarding the behavior when O_NONBLOCK is absent

Nayan Deshmukh nayan26deshmukh at gmail.com
Sat Jun 4 01:59:07 UTC 2022


Hello,

The libevdev requires that the fd should be opened with the O_NONBLOCK
flag. What kind of behaviour can we expect if we try to create a
libevdev device without the O_NONBLOCK flag? The main question is
whether it will be blocked or it could be undefined behaviour as well.

A little background, I have written libevdev bindings in rust [1] and
I wanted to document the kind of behaviour people should expect and
whether I should mark the function as unsafe if it were to exhibit
undefined behaviour.

Thanks,
Nayan Deshmukh

[1] https://github.com/ndesh26/evdev-rs


More information about the Input-tools mailing list