I am writing some code around libgpiod’s interface. For example, I want to set a line to output high. Under the hood, libgpiod opens an fd provided by the kernel for the line, and then calls
ioctl(fd, GPIO_V2_LINE_SET_VALUES_IOCTL, ...).
My questions are:
Is this particular
ioctl()call (with the
GPIO_V2...argument) theoretically (potentially) blocking in the same way that writing to an arbitrary file descriptor can be?
ioctl()calls in general theoretically blocking? For example, requesting the line in the first place also involves an
ioctl()on a fd for the chip. What about I2C
If it is blocking, is the underlying
fdin the line struct (
line->fd_handle->fd) the one I need to wait on in an event loop (eg.
epoll()or an abstracted event library like libuv)?
I have tried to answer this question through research, but (a) searching for any combination of "ioctl" and "blocking" just gives results for setting a fd to be blocking or not and (b) it’s not in the man pages or kernel docs that I can find.