2

Let's consider the following (imaginary) device: a clock which takes 1 second to query, then returns the current time. We want to write a character device driver for it, which supports read operations only.

  • I believe non-blocking reads would not make sense for such a device, because we cannot cache the results of a read. Would you agree?
  • Is it allowed to only handle blocking reads? If so, what error code should non-blocking reads return? Or what other way do we have to specify that we don't support non-blocking operations?

I'd like to understand this better before I implement a character device driver for a real device. I'm interested in Linux, but I believe the answer is unlikely to be Linux-specific.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.