lttng-sessiond's new notification subsystem uses eventfd() which is only available since Linux 2.6.22
lttng-sessiond's new notification subsystem uses eventfd() which is only available since Linux 2.6.22. A pipe-based (or better idea?) compatibility layer should be put in place to accommodate older, supported, kernels.
Updated by Jonathan Rajotte Julien over 5 years ago
Per the README.md file the needed version for the Linux kernel is >= 2.6.27 for epoll support, otherwise older kernel are not supported. Does using eventfd really a problem considering that we don't offer support for older kernel older 2.6.27?
Still, we have a problem related to the flag passed to eventfd.
handle->cmd_queue.event_fd = eventfd(0, EFD_CLOEXEC | EFD_SEMAPHORE);
From man eventfd:
EFD_CLOEXEC (since Linux 2.6.27) Set the close-on-exec (FD_CLOEXEC) flag on the new file descrip‐ tor. See the description of the O_CLOEXEC flag in open(2) for reasons why this may be useful. EFD_NONBLOCK (since Linux 2.6.27) Set the O_NONBLOCK file status flag on the new open file description. Using this flag saves extra calls to fcntl(2) to achieve the same result. EFD_SEMAPHORE (since Linux 2.6.30) Provide semaphore-like semantics for reads from the new file descriptor. See below.
The use of EFD_SEMAPHORE seems to be more problematic here.
What do you think?