1 <?xml version='
1.0'
?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY % entities SYSTEM
"custom-entities.ent" >
9 SPDX-License-Identifier: LGPL-2.1+
12 <refentry id=
"udev_device_get_syspath"
13 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
16 <title>udev_device_get_syspath
</title>
17 <productname>systemd
</productname>
21 <refentrytitle>udev_device_get_syspath
</refentrytitle>
22 <manvolnum>3</manvolnum>
26 <refname>udev_device_get_syspath
</refname>
27 <refname>udev_device_get_sysname
</refname>
28 <refname>udev_device_get_sysnum
</refname>
29 <refname>udev_device_get_devpath
</refname>
30 <refname>udev_device_get_devnode
</refname>
31 <refname>udev_device_get_devnum
</refname>
32 <refname>udev_device_get_devtype
</refname>
33 <refname>udev_device_get_subsystem
</refname>
34 <refname>udev_device_get_driver
</refname>
35 <refname>udev_device_get_udev
</refname>
36 <refname>udev_device_get_parent
</refname>
37 <refname>udev_device_get_parent_with_subsystem_devtype
</refname>
38 <refname>udev_device_get_is_initialized
</refname>
39 <refname>udev_device_get_action
</refname>
41 <refpurpose>Query device properties
</refpurpose>
46 <funcsynopsisinfo>#include
<libudev.h
></funcsynopsisinfo>
49 <funcdef>const char *
<function>udev_device_get_syspath
</function></funcdef>
50 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
54 <funcdef>const char *
<function>udev_device_get_sysname
</function></funcdef>
55 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
59 <funcdef>const char *
<function>udev_device_get_sysnum
</function></funcdef>
60 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
64 <funcdef>const char *
<function>udev_device_get_devpath
</function></funcdef>
65 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
69 <funcdef>const char *
<function>udev_device_get_devnode
</function></funcdef>
70 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
74 <funcdef>dev_t
<function>udev_device_get_devnum
</function></funcdef>
75 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
79 <funcdef>const char *
<function>udev_device_get_devtype
</function></funcdef>
80 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
84 <funcdef>const char *
<function>udev_device_get_subsystem
</function></funcdef>
85 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
89 <funcdef>const char *
<function>udev_device_get_driver
</function></funcdef>
90 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
94 <funcdef>struct udev *
<function>udev_device_get_udev
</function></funcdef>
95 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
99 <funcdef>struct udev_device *
<function>udev_device_get_parent
</function></funcdef>
100 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
104 <funcdef>struct udev_device *
<function>udev_device_get_parent_with_subsystem_devtype
</function></funcdef>
105 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
106 <paramdef>const char *
<parameter>subsystem
</parameter></paramdef>
107 <paramdef>const char *
<parameter>devtype
</parameter></paramdef>
111 <funcdef>int
<function>udev_device_get_is_initialized
</function></funcdef>
112 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
116 <funcdef>const char *
<function>udev_device_get_action
</function></funcdef>
117 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
124 <title>Description</title>
126 <para>XXX: Add documentation.</para>
130 <title>Return Value
</title>
132 <para>On success,
<function>udev_device_get_syspath()
</function>,
133 <function>udev_device_get_sysname()
</function>,
134 <function>udev_device_get_sysnum()
</function>,
135 <function>udev_device_get_devpath()
</function>,
136 <function>udev_device_get_devnode()
</function>,
137 <function>udev_device_get_devtype()
</function>,
138 <function>udev_device_get_subsystem()
</function>,
139 <function>udev_device_get_driver()
</function> and
140 <function>udev_device_get_action()
</function> return a pointer
141 to a constant string that describes the requested property. The
142 lifetime of this string is bound to the device it was requested
143 on. On failure, each function may return
144 <constant>NULL
</constant>.
</para>
146 <para>On success,
<function>udev_device_get_devnum()
</function>
147 returns the device type of the passed device. On failure, a
148 device type with minor and major number set to
149 <constant>0</constant> is returned.
</para>
151 <para><function>udev_device_get_udev()
</function> always returns
152 a valid pointer to the udev context that this device belongs
155 <para>On success,
<function>udev_device_get_parent()
</function>
157 <function>udev_device_get_parent_with_subsystem_devtype()
</function>
158 return a pointer to the parent device. No additional reference
159 to this device is acquired, but the child device owns a reference
160 to such a parent device. On failure,
<constant>NULL
</constant>
163 <para>On success,
<function>udev_device_get_is_initialized()
</function> returns either
<constant>1</constant> or
164 <constant>0</constant>, depending on whether the passed device has already been initialized by udev or not. On
165 failure, a negative error code is returned. Note that devices for which no udev rules are defined are never
166 reported initialized.
</para>
170 <title>See Also
</title>
173 <citerefentry><refentrytitle>udev_new
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
174 <citerefentry><refentrytitle>udev_device_new_from_syspath
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
175 <citerefentry><refentrytitle>udev_device_has_tag
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
176 <citerefentry><refentrytitle>udev_enumerate_new
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
177 <citerefentry><refentrytitle>udev_monitor_new_from_netlink
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
178 <citerefentry><refentrytitle>udev_list_entry
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
179 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,