1
0
mirror of https://github.com/systemd/systemd synced 2025-10-06 00:13:24 +02:00
Files
systemd/man/sd_device_enumerator_new-example.c
Shubhendra Kushwaha fd3b5e530a docs: add man pages for sd_device_enumerator_[new,ref,unref,unrefp] (#37586)
For #20929.

(cherry picked from commit ac8ed83947)
(cherry picked from commit 17e5c276b9)
2025-05-28 19:16:16 +01:00

23 lines
469 B
C

/* SPDX-License-Identifier: MIT-0 */
#include <stdio.h>
#include <systemd/sd-device.h>
int main(void) {
sd_device_enumerator *enumerator;
int r;
r = sd_device_enumerator_new(&enumerator);
if (r < 0) {
fprintf(stderr, "Failed to create enumerator: %s\n", strerror(-r));
return 1;
}
sd_device_enumerator_ref(enumerator);
sd_device_enumerator_unref(enumerator);
sd_device_enumerator_unref(enumerator);
return 0;
}