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 This file is part of systemd.
13 Copyright 2015 David Herrmann <dh.herrmann@gmail.com>
15 systemd is free software; you can redistribute it and/or modify it
16 under the terms of the GNU Lesser General Public License as published by
17 the Free Software Foundation; either version 2.1 of the License, or
18 (at your option) any later version.
20 systemd is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 Lesser General Public License for more details.
25 You should have received a copy of the GNU Lesser General Public License
26 along with systemd; If not, see <http://www.gnu.org/licenses/>.
29 <refentry id=
"udev_device_get_syspath"
30 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
33 <title>udev_device_get_syspath
</title>
34 <productname>systemd
</productname>
38 <contrib>Developer
</contrib>
39 <firstname>David
</firstname>
40 <surname>Herrmann
</surname>
41 <email>dh.herrmann@gmail.com
</email>
47 <refentrytitle>udev_device_get_syspath
</refentrytitle>
48 <manvolnum>3</manvolnum>
52 <refname>udev_device_get_syspath
</refname>
53 <refname>udev_device_get_sysname
</refname>
54 <refname>udev_device_get_sysnum
</refname>
55 <refname>udev_device_get_devpath
</refname>
56 <refname>udev_device_get_devnode
</refname>
57 <refname>udev_device_get_devnum
</refname>
58 <refname>udev_device_get_devtype
</refname>
59 <refname>udev_device_get_subsystem
</refname>
60 <refname>udev_device_get_driver
</refname>
61 <refname>udev_device_get_udev
</refname>
62 <refname>udev_device_get_parent
</refname>
63 <refname>udev_device_get_parent_with_subsystem_devtype
</refname>
64 <refname>udev_device_get_is_initialized
</refname>
65 <refname>udev_device_get_action
</refname>
67 <refpurpose>Query device properties
</refpurpose>
72 <funcsynopsisinfo>#include
<libudev.h
></funcsynopsisinfo>
75 <funcdef>const char *
<function>udev_device_get_syspath
</function></funcdef>
76 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
80 <funcdef>const char *
<function>udev_device_get_sysname
</function></funcdef>
81 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
85 <funcdef>const char *
<function>udev_device_get_sysnum
</function></funcdef>
86 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
90 <funcdef>const char *
<function>udev_device_get_devpath
</function></funcdef>
91 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
95 <funcdef>const char *
<function>udev_device_get_devnode
</function></funcdef>
96 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
100 <funcdef>dev_t
<function>udev_device_get_devnum
</function></funcdef>
101 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
105 <funcdef>const char *
<function>udev_device_get_devtype
</function></funcdef>
106 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
110 <funcdef>const char *
<function>udev_device_get_subsystem
</function></funcdef>
111 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
115 <funcdef>const char *
<function>udev_device_get_driver
</function></funcdef>
116 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
120 <funcdef>struct udev *
<function>udev_device_get_udev
</function></funcdef>
121 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
125 <funcdef>struct udev_device *
<function>udev_device_get_parent
</function></funcdef>
126 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
130 <funcdef>struct udev_device *
<function>udev_device_get_parent_with_subsystem_devtype
</function></funcdef>
131 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
132 <paramdef>const char *
<parameter>subsystem
</parameter></paramdef>
133 <paramdef>const char *
<parameter>devtype
</parameter></paramdef>
137 <funcdef>int
<function>udev_device_get_is_initialized
</function></funcdef>
138 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
142 <funcdef>const char *
<function>udev_device_get_action
</function></funcdef>
143 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
150 <title>Description</title>
152 <para>XXX: Add documentation.</para>
156 <title>Return Value
</title>
158 <para>On success,
<function>udev_device_get_syspath()
</function>,
159 <function>udev_device_get_sysname()
</function>,
160 <function>udev_device_get_sysnum()
</function>,
161 <function>udev_device_get_devpath()
</function>,
162 <function>udev_device_get_devnode()
</function>,
163 <function>udev_device_get_devtype()
</function>,
164 <function>udev_device_get_subsystem()
</function>,
165 <function>udev_device_get_driver()
</function> and
166 <function>udev_device_get_action()
</function> return a pointer
167 to a constant string that describes the requested property. The
168 lifetime of this string is bound to the device it was requested
169 on. On failure, each function may return
170 <constant>NULL
</constant>.
</para>
172 <para>On success,
<function>udev_device_get_devnum()
</function>
173 returns the device type of the passed device. On failure, a
174 device type with minor and major number set to
175 <constant>0</constant> is returned.
</para>
177 <para><function>udev_device_get_udev()
</function> always returns
178 a valid pointer to the udev context that this device belongs
181 <para>On success,
<function>udev_device_get_parent()
</function>
183 <function>udev_device_get_parent_with_subsystem_devtype()
</function>
184 return a pointer to the parent device. No additional reference
185 to this device is acquired, but the child device owns a reference
186 to such a parent device. On failure,
<constant>NULL
</constant>
189 <para>On success,
<function>udev_device_get_is_initialized()
</function> returns either
<constant>1</constant> or
190 <constant>0</constant>, depending on whether the passed device has already been initialized by udev or not. On
191 failure, a negative error code is returned. Note that devices for which no udev rules are defined are never
192 reported initialized.
</para>
196 <title>See Also
</title>
199 <citerefentry><refentrytitle>udev_new
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
200 <citerefentry><refentrytitle>udev_device_new_from_syspath
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
201 <citerefentry><refentrytitle>udev_device_has_tag
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
202 <citerefentry><refentrytitle>udev_enumerate_new
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
203 <citerefentry><refentrytitle>udev_monitor_new_from_netlink
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
204 <citerefentry><refentrytitle>udev_list_entry
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
205 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,