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 This file is part of systemd.
11 Copyright 2015 David Herrmann <dh.herrmann@gmail.com>
13 systemd is free software; you can redistribute it and/or modify it
14 under the terms of the GNU Lesser General Public License as published by
15 the Free Software Foundation; either version 2.1 of the License, or
16 (at your option) any later version.
18 systemd is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
23 You should have received a copy of the GNU Lesser General Public License
24 along with systemd; If not, see <http://www.gnu.org/licenses/>.
27 <refentry id=
"udev_device_get_syspath"
28 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
31 <title>udev_device_get_syspath
</title>
32 <productname>systemd
</productname>
36 <contrib>Developer
</contrib>
37 <firstname>David
</firstname>
38 <surname>Herrmann
</surname>
39 <email>dh.herrmann@gmail.com
</email>
45 <refentrytitle>udev_device_get_syspath
</refentrytitle>
46 <manvolnum>3</manvolnum>
50 <refname>udev_device_get_syspath
</refname>
51 <refname>udev_device_get_sysname
</refname>
52 <refname>udev_device_get_sysnum
</refname>
53 <refname>udev_device_get_devpath
</refname>
54 <refname>udev_device_get_devnode
</refname>
55 <refname>udev_device_get_devnum
</refname>
56 <refname>udev_device_get_devtype
</refname>
57 <refname>udev_device_get_subsystem
</refname>
58 <refname>udev_device_get_driver
</refname>
59 <refname>udev_device_get_udev
</refname>
60 <refname>udev_device_get_parent
</refname>
61 <refname>udev_device_get_parent_with_subsystem_devtype
</refname>
62 <refname>udev_device_get_is_initialized
</refname>
63 <refname>udev_device_get_action
</refname>
65 <refpurpose>Query device properties
</refpurpose>
70 <funcsynopsisinfo>#include
<libudev.h
></funcsynopsisinfo>
73 <funcdef>const char *
<function>udev_device_get_syspath
</function></funcdef>
74 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
78 <funcdef>const char *
<function>udev_device_get_sysname
</function></funcdef>
79 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
83 <funcdef>const char *
<function>udev_device_get_sysnum
</function></funcdef>
84 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
88 <funcdef>const char *
<function>udev_device_get_devpath
</function></funcdef>
89 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
93 <funcdef>const char *
<function>udev_device_get_devnode
</function></funcdef>
94 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
98 <funcdef>dev_t
<function>udev_device_get_devnum
</function></funcdef>
99 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
103 <funcdef>const char *
<function>udev_device_get_devtype
</function></funcdef>
104 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
108 <funcdef>const char *
<function>udev_device_get_subsystem
</function></funcdef>
109 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
113 <funcdef>const char *
<function>udev_device_get_driver
</function></funcdef>
114 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
118 <funcdef>struct udev *
<function>udev_device_get_udev
</function></funcdef>
119 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
123 <funcdef>struct udev_device *
<function>udev_device_get_parent
</function></funcdef>
124 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
128 <funcdef>struct udev_device *
<function>udev_device_get_parent_with_subsystem_devtype
</function></funcdef>
129 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
130 <paramdef>const char *
<parameter>subsystem
</parameter></paramdef>
131 <paramdef>const char *
<parameter>devtype
</parameter></paramdef>
135 <funcdef>int
<function>udev_device_get_is_initialized
</function></funcdef>
136 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
140 <funcdef>const char *
<function>udev_device_get_action
</function></funcdef>
141 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
148 <title>Description</title>
150 <para>XXX: Add documentation.</para>
154 <title>Return Value
</title>
156 <para>On success,
<function>udev_device_get_syspath()
</function>,
157 <function>udev_device_get_sysname()
</function>,
158 <function>udev_device_get_sysnum()
</function>,
159 <function>udev_device_get_devpath()
</function>,
160 <function>udev_device_get_devnode()
</function>,
161 <function>udev_device_get_devtype()
</function>,
162 <function>udev_device_get_subsystem()
</function>,
163 <function>udev_device_get_driver()
</function> and
164 <function>udev_device_get_action()
</function> return a pointer
165 to a constant string that describes the requested property. The
166 lifetime of this string is bound to the device it was requested
167 on. On failure, each function may return
168 <constant>NULL
</constant>.
</para>
170 <para>On success,
<function>udev_device_get_devnum()
</function>
171 returns the device type of the passed device. On failure, a
172 device type with minor and major number set to
173 <constant>0</constant> is returned.
</para>
175 <para><function>udev_device_get_udev()
</function> always returns
176 a valid pointer to the udev context that this device belongs
179 <para>On success,
<function>udev_device_get_parent()
</function>
181 <function>udev_device_get_parent_with_subsystem_devtype()
</function>
182 return a pointer to the parent device. No additional reference
183 to this device is acquired, but the child device owns a reference
184 to such a parent device. On failure,
<constant>NULL
</constant>
187 <para>On success,
<function>udev_device_get_is_initialized()
</function> returns either
<constant>1</constant> or
188 <constant>0</constant>, depending on whether the passed device has already been initialized by udev or not. On
189 failure, a negative error code is returned. Note that devices for which no udev rules are defined are never
190 reported initialized.
</para>
194 <title>See Also
</title>
197 <citerefentry><refentrytitle>udev_new
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
198 <citerefentry><refentrytitle>udev_device_new_from_syspath
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
199 <citerefentry><refentrytitle>udev_device_has_tag
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
200 <citerefentry><refentrytitle>udev_enumerate_new
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
201 <citerefentry><refentrytitle>udev_monitor_new_from_netlink
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
202 <citerefentry><refentrytitle>udev_list_entry
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
203 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,