File: sd_device_enumerator_new-example.c

package info (click to toggle)
systemd 259.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 113,388 kB
  • sloc: ansic: 727,211; xml: 121,125; python: 36,732; sh: 34,990; cpp: 946; makefile: 278; awk: 102; lisp: 13; sed: 1
file content (22 lines) | stat: -rw-r--r-- 469 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* 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;
}