]>
Commit | Line | Data |
---|---|---|
06255d6f DH |
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" > | |
5 | %entities; | |
6 | ]> | |
7 | ||
8 | <!-- | |
572eb058 ZJS |
9 | SPDX-License-Identifier: LGPL-2.1+ |
10 | ||
06255d6f DH |
11 | This file is part of systemd. |
12 | ||
13 | Copyright 2015 David Herrmann <dh.herrmann@gmail.com> | |
14 | ||
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. | |
19 | ||
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. | |
24 | ||
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/>. | |
27 | --> | |
28 | ||
29 | <refentry id="udev_device_get_syspath" | |
30 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
31 | ||
32 | <refentryinfo> | |
33 | <title>udev_device_get_syspath</title> | |
34 | <productname>systemd</productname> | |
35 | ||
36 | <authorgroup> | |
37 | <author> | |
38 | <contrib>Developer</contrib> | |
39 | <firstname>David</firstname> | |
40 | <surname>Herrmann</surname> | |
41 | <email>dh.herrmann@gmail.com</email> | |
42 | </author> | |
43 | </authorgroup> | |
44 | </refentryinfo> | |
45 | ||
46 | <refmeta> | |
47 | <refentrytitle>udev_device_get_syspath</refentrytitle> | |
48 | <manvolnum>3</manvolnum> | |
49 | </refmeta> | |
50 | ||
51 | <refnamediv> | |
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> | |
66 | ||
67 | <refpurpose>Query device properties</refpurpose> | |
68 | </refnamediv> | |
69 | ||
70 | <refsynopsisdiv> | |
71 | <funcsynopsis> | |
72 | <funcsynopsisinfo>#include <libudev.h></funcsynopsisinfo> | |
73 | ||
74 | <funcprototype> | |
75 | <funcdef>const char *<function>udev_device_get_syspath</function></funcdef> | |
76 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
77 | </funcprototype> | |
78 | ||
79 | <funcprototype> | |
80 | <funcdef>const char *<function>udev_device_get_sysname</function></funcdef> | |
81 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
82 | </funcprototype> | |
83 | ||
84 | <funcprototype> | |
85 | <funcdef>const char *<function>udev_device_get_sysnum</function></funcdef> | |
86 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
87 | </funcprototype> | |
88 | ||
89 | <funcprototype> | |
90 | <funcdef>const char *<function>udev_device_get_devpath</function></funcdef> | |
91 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
92 | </funcprototype> | |
93 | ||
94 | <funcprototype> | |
95 | <funcdef>const char *<function>udev_device_get_devnode</function></funcdef> | |
96 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
97 | </funcprototype> | |
98 | ||
99 | <funcprototype> | |
100 | <funcdef>dev_t <function>udev_device_get_devnum</function></funcdef> | |
101 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
102 | </funcprototype> | |
103 | ||
104 | <funcprototype> | |
105 | <funcdef>const char *<function>udev_device_get_devtype</function></funcdef> | |
106 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
107 | </funcprototype> | |
108 | ||
109 | <funcprototype> | |
110 | <funcdef>const char *<function>udev_device_get_subsystem</function></funcdef> | |
111 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
112 | </funcprototype> | |
113 | ||
114 | <funcprototype> | |
115 | <funcdef>const char *<function>udev_device_get_driver</function></funcdef> | |
116 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
117 | </funcprototype> | |
118 | ||
119 | <funcprototype> | |
120 | <funcdef>struct udev *<function>udev_device_get_udev</function></funcdef> | |
121 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
122 | </funcprototype> | |
123 | ||
124 | <funcprototype> | |
125 | <funcdef>struct udev_device *<function>udev_device_get_parent</function></funcdef> | |
126 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
127 | </funcprototype> | |
128 | ||
129 | <funcprototype> | |
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> | |
7f7341e3 AE |
132 | <paramdef>const char *<parameter>subsystem</parameter></paramdef> |
133 | <paramdef>const char *<parameter>devtype</parameter></paramdef> | |
06255d6f DH |
134 | </funcprototype> |
135 | ||
136 | <funcprototype> | |
137 | <funcdef>int <function>udev_device_get_is_initialized</function></funcdef> | |
138 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
139 | </funcprototype> | |
140 | ||
141 | <funcprototype> | |
142 | <funcdef>const char *<function>udev_device_get_action</function></funcdef> | |
143 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
06255d6f DH |
144 | </funcprototype> |
145 | ||
146 | </funcsynopsis> | |
147 | </refsynopsisdiv> | |
148 | ||
149 | <!--<refsect1> | |
150 | <title>Description</title> | |
151 | ||
152 | <para>XXX: Add documentation.</para> | |
153 | </refsect1>--> | |
154 | ||
155 | <refsect1> | |
156 | <title>Return Value</title> | |
157 | ||
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> | |
171 | ||
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> | |
176 | ||
177 | <para><function>udev_device_get_udev()</function> always returns | |
178 | a valid pointer to the udev context that this device belongs | |
179 | to.</para> | |
180 | ||
181 | <para>On success, <function>udev_device_get_parent()</function> | |
182 | and | |
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 | |
a8eaaee7 | 186 | to such a parent device. On failure, <constant>NULL</constant> |
06255d6f DH |
187 | is returned.</para> |
188 | ||
891a15ca LP |
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> | |
06255d6f DH |
193 | </refsect1> |
194 | ||
195 | <refsect1> | |
196 | <title>See Also</title> | |
197 | ||
198 | <para> | |
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>, | |
206 | </para> | |
207 | </refsect1> | |
208 | ||
209 | </refentry> |