1UDEV_DEVICE_HAS_TAG(3) udev_device_has_tag UDEV_DEVICE_HAS_TAG(3)
2
3
4
6 udev_device_has_tag, udev_device_get_devlinks_list_entry,
7 udev_device_get_properties_list_entry, udev_device_get_tags_list_entry,
8 udev_device_get_sysattr_list_entry, udev_device_get_property_value,
9 udev_device_get_sysattr_value, udev_device_set_sysattr_value - Retrieve
10 or set device attributes
11
13 #include <libudev.h>
14
15 struct udev_list_entry
16 *udev_device_get_devlinks_list_entry(struct udev_device *udev_device);
17
18 struct udev_list_entry
19 *udev_device_get_properties_list_entry(struct udev_device *udev_device);
20
21 struct udev_list_entry
22 *udev_device_get_tags_list_entry(struct udev_device *udev_device);
23
24 struct udev_list_entry
25 *udev_device_get_sysattr_list_entry(struct udev_device *udev_device);
26
27 const char
28 *udev_device_get_property_value(struct udev_device *udev_device,
29 const char *key);
30
31 int udev_device_has_tag(struct udev_device *udev_device,
32 const char *tag);
33
34 const char
35 *udev_device_get_sysattr_value(struct udev_device *udev_device,
36 const char *sysattr);
37
38 int udev_device_set_sysattr_value(struct udev_device *udev_device,
39 const char *sysattr,
40 const char *value);
41
43 On success, udev_device_get_devlinks_list_entry(),
44 udev_device_get_properties_list_entry(),
45 udev_device_get_tags_list_entry() and
46 udev_device_get_sysattr_list_entry() return a pointer to the first
47 entry of the retrieved list. If that list is empty, or if an error
48 occurred, NULL is returned.
49
50 On success, udev_device_get_property_value() and
51 udev_device_get_sysattr_value() return a pointer to a constant string
52 of the requested value. On error, NULL is returned. Attributes that may
53 contain NUL bytes should not be retrieved with
54 udev_device_get_sysattr_value(); instead, read them directly from the
55 files within the device's syspath.
56
57 On success, udev_device_set_sysattr_value() returns an integer greater
58 than, or equal to, 0. On failure, a negative error code is returned.
59 Values that contain NUL bytes should not be set with this function;
60 instead, write them directly to the files within the device's syspath.
61
62 On success, udev_device_has_tag() returns 1 or 0, depending on whether
63 the device has the given tag or not. On failure, a negative error code
64 is returned.
65
67 udev_new(3), udev_device_new_from_syspath(3),
68 udev_device_get_syspath(3), udev_enumerate_new(3),
69 udev_monitor_new_from_netlink(3), udev_list_entry(3), systemd(1),
70
71
72
73systemd 245 UDEV_DEVICE_HAS_TAG(3)