Skip to content

FreeBSD compatibility

Niclas Zeising requested to merge zeising/libevdev:zeising/fbsd-compat into master

Changes to make libevdev work on FreeBSD. FreeBSD has an old version of this library in ports, with these patches, the latest version works fine (including tests).

The patch consists of several parts:

  • Add FreeBSD compatible input.h and uinput.h. This is done by moving the Linux and FreeBSD specific headers to include/linux/linux and include/linux/freebsd respectively, and then include those from the common files in include/linux. A similar change has been made to libinput.

  • Remove use of signalfd(), as it does not exist on FreeBSD. Since signalfd() is only used in a couple of tools, use plain signals and signal handling instead.

  • Implement a FreeBSD version of fetch_syspath_and_devnode(). Since FreeBSD does not have sysfs, figure out the device node in use directly instead of go via sysfs. Consequently, libevdev_uinput->syspath is always NULL on FreeBSD.

  • Update tests to work on FreeBSD, and add two FreeBSD-specific tests regarding syspath and devnode handling.

  • Document FreeBSD quirks in the external API.

Edited by Niclas Zeising

Merge request reports