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+
11 Copyright © 2015 David Herrmann <dh.herrmann@gmail.com>
14 <refentry id=
"udev_device_get_syspath"
15 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
18 <title>udev_device_get_syspath
</title>
19 <productname>systemd
</productname>
23 <refentrytitle>udev_device_get_syspath
</refentrytitle>
24 <manvolnum>3</manvolnum>
28 <refname>udev_device_get_syspath
</refname>
29 <refname>udev_device_get_sysname
</refname>
30 <refname>udev_device_get_sysnum
</refname>
31 <refname>udev_device_get_devpath
</refname>
32 <refname>udev_device_get_devnode
</refname>
33 <refname>udev_device_get_devnum
</refname>
34 <refname>udev_device_get_devtype
</refname>
35 <refname>udev_device_get_subsystem
</refname>
36 <refname>udev_device_get_driver
</refname>
37 <refname>udev_device_get_udev
</refname>
38 <refname>udev_device_get_parent
</refname>
39 <refname>udev_device_get_parent_with_subsystem_devtype
</refname>
40 <refname>udev_device_get_is_initialized
</refname>
41 <refname>udev_device_get_action
</refname>
43 <refpurpose>Query device properties
</refpurpose>
48 <funcsynopsisinfo>#include
<libudev.h
></funcsynopsisinfo>
51 <funcdef>const char *
<function>udev_device_get_syspath
</function></funcdef>
52 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
56 <funcdef>const char *
<function>udev_device_get_sysname
</function></funcdef>
57 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
61 <funcdef>const char *
<function>udev_device_get_sysnum
</function></funcdef>
62 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
66 <funcdef>const char *
<function>udev_device_get_devpath
</function></funcdef>
67 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
71 <funcdef>const char *
<function>udev_device_get_devnode
</function></funcdef>
72 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
76 <funcdef>dev_t
<function>udev_device_get_devnum
</function></funcdef>
77 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
81 <funcdef>const char *
<function>udev_device_get_devtype
</function></funcdef>
82 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
86 <funcdef>const char *
<function>udev_device_get_subsystem
</function></funcdef>
87 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
91 <funcdef>const char *
<function>udev_device_get_driver
</function></funcdef>
92 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
96 <funcdef>struct udev *
<function>udev_device_get_udev
</function></funcdef>
97 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
101 <funcdef>struct udev_device *
<function>udev_device_get_parent
</function></funcdef>
102 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
106 <funcdef>struct udev_device *
<function>udev_device_get_parent_with_subsystem_devtype
</function></funcdef>
107 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
108 <paramdef>const char *
<parameter>subsystem
</parameter></paramdef>
109 <paramdef>const char *
<parameter>devtype
</parameter></paramdef>
113 <funcdef>int
<function>udev_device_get_is_initialized
</function></funcdef>
114 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
118 <funcdef>const char *
<function>udev_device_get_action
</function></funcdef>
119 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
126 <title>Description</title>
128 <para>XXX: Add documentation.</para>
132 <title>Return Value
</title>
134 <para>On success,
<function>udev_device_get_syspath()
</function>,
135 <function>udev_device_get_sysname()
</function>,
136 <function>udev_device_get_sysnum()
</function>,
137 <function>udev_device_get_devpath()
</function>,
138 <function>udev_device_get_devnode()
</function>,
139 <function>udev_device_get_devtype()
</function>,
140 <function>udev_device_get_subsystem()
</function>,
141 <function>udev_device_get_driver()
</function> and
142 <function>udev_device_get_action()
</function> return a pointer
143 to a constant string that describes the requested property. The
144 lifetime of this string is bound to the device it was requested
145 on. On failure, each function may return
146 <constant>NULL
</constant>.
</para>
148 <para>On success,
<function>udev_device_get_devnum()
</function>
149 returns the device type of the passed device. On failure, a
150 device type with minor and major number set to
151 <constant>0</constant> is returned.
</para>
153 <para><function>udev_device_get_udev()
</function> always returns
154 a valid pointer to the udev context that this device belongs
157 <para>On success,
<function>udev_device_get_parent()
</function>
159 <function>udev_device_get_parent_with_subsystem_devtype()
</function>
160 return a pointer to the parent device. No additional reference
161 to this device is acquired, but the child device owns a reference
162 to such a parent device. On failure,
<constant>NULL
</constant>
165 <para>On success,
<function>udev_device_get_is_initialized()
</function> returns either
<constant>1</constant> or
166 <constant>0</constant>, depending on whether the passed device has already been initialized by udev or not. On
167 failure, a negative error code is returned. Note that devices for which no udev rules are defined are never
168 reported initialized.
</para>
172 <title>See Also
</title>
175 <citerefentry><refentrytitle>udev_new
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
176 <citerefentry><refentrytitle>udev_device_new_from_syspath
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
177 <citerefentry><refentrytitle>udev_device_has_tag
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
178 <citerefentry><refentrytitle>udev_enumerate_new
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
179 <citerefentry><refentrytitle>udev_monitor_new_from_netlink
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
180 <citerefentry><refentrytitle>udev_list_entry
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
181 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,