mcpp index

compat.libudev

#include

libudev-zero 1.0.5 — the libudev ABI without systemd or a daemon, for libinput

#include <libudev.h>
mcpp add compat.libudev@1.0.5

Usage

From this repository's own test project — built and run by CI, not written for the website.

// compat.libudev — behavioral test against /sys, no daemon.
//
// libudev-zero reads /sys directly instead of talking to udevd, which is the
// whole reason it is here: a subos has no udev daemon, and an implementation
// that needed one would work on a developer's machine and nowhere else. So the
// test enumerates REAL devices — that is the thing that would silently return
// nothing if the package were built wrong.

#ifdef __linux__

#include <libudev.h>

#include <dlfcn.h>
#include <cstdio>
#include <cstring>
#include <string>

namespace {
int failures = 0;
void check(bool ok, const char *what)
{
    std::printf("%-58s %s\n", what, ok ? "ok" : "FAILED");
// …

tests/examples/libudev/tests/libudev.cpp · project tests/examples/libudev

Build

targets
udev (shared)
language
c++23
C standard
c11
import std
no
include dirs
*, mcpp_generated

Sources (5)

  • */udev.c
  • */udev_device.c
  • */udev_enumerate.c
  • */udev_list.c
  • */udev_monitor.c

Generated files

  • mcpp_generated/libudev.h

Versions

VersionPlatforms Mirrorssha256
1.0.5 latest Linux GLOBAL CN bf4372f79ddb…