]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd/sd-device/test-sd-device-thread.c
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
10 #include "device-util.h"
13 static void* thread(void *p
) {
16 assert_se(!(*d
= sd_device_unref(*d
)));
21 int main(int argc
, char *argv
[]) {
24 const char *key
, *value
;
26 assert_se(unsetenv("SYSTEMD_MEMPOOL") == 0);
28 assert_se(sd_device_new_from_syspath(&loopback
, "/sys/class/net/lo") >= 0);
30 FOREACH_DEVICE_PROPERTY(loopback
, key
, value
)
31 printf("%s=%s\n", key
, value
);
33 assert_se(pthread_create(&t
, NULL
, thread
, &loopback
) == 0);
34 assert_se(pthread_join(t
, NULL
) == 0);