]> git.proxmox.com Git - systemd.git/blob - docs/libudev/html/libudev-udev-device.html
Imported Upstream version 204
[systemd.git] / docs / libudev / html / libudev-udev-device.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>udev_device</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="index.html" title="libudev Reference Manual">
8 <link rel="up" href="ch01.html" title="API Reference">
9 <link rel="prev" href="libudev-udev-list.html" title="udev_list">
10 <link rel="next" href="libudev-udev-monitor.html" title="udev_monitor">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="libudev-udev-list.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">libudev Reference Manual</th>
21 <td><a accesskey="n" href="libudev-udev-monitor.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#libudev-udev-device.synopsis" class="shortcut">Top</a>
25  | 
26 <a href="#libudev-udev-device.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry">
30 <a name="libudev-udev-device"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
33 <h2><span class="refentrytitle"><a name="libudev-udev-device.top_of_page"></a>udev_device</span></h2>
34 <p>udev_device — kernel sys devices</p>
35 </td>
36 <td valign="top" align="right"></td>
37 </tr></table></div>
38 <div class="refsynopsisdiv">
39 <a name="libudev-udev-device.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device">udev_device</a>;
41 struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-ref" title="udev_device_ref ()">udev_device_ref</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
42 struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-unref" title="udev_device_unref ()">udev_device_unref</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
43 struct <a class="link" href="libudev-udev.html#udev" title="struct udev"><span class="returnvalue">udev</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-get-udev" title="udev_device_get_udev ()">udev_device_get_udev</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
44 struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-new-from-syspath" title="udev_device_new_from_syspath ()">udev_device_new_from_syspath</a> (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
45 <em class="parameter"><code>const <span class="type">char</span> *syspath</code></em>);
46 struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-new-from-devnum" title="udev_device_new_from_devnum ()">udev_device_new_from_devnum</a> (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
47 <em class="parameter"><code><span class="type">char</span> type</code></em>,
48 <em class="parameter"><code><span class="type">dev_t</span> devnum</code></em>);
49 struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-new-from-subsystem-sysname" title="udev_device_new_from_subsystem_sysname ()">udev_device_new_from_subsystem_sysname</a>
50 (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
51 <em class="parameter"><code>const <span class="type">char</span> *subsystem</code></em>,
52 <em class="parameter"><code>const <span class="type">char</span> *sysname</code></em>);
53 struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-new-from-device-id" title="udev_device_new_from_device_id ()">udev_device_new_from_device_id</a> (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
54 <em class="parameter"><code><span class="type">char</span> *id</code></em>);
55 struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-new-from-environment" title="udev_device_new_from_environment ()">udev_device_new_from_environment</a> (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);
56 struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-get-parent" title="udev_device_get_parent ()">udev_device_get_parent</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
57 struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-get-parent-with-subsystem-devtype" title="udev_device_get_parent_with_subsystem_devtype ()">udev_device_get_parent_with_subsystem_devtype</a>
58 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
59 <em class="parameter"><code>const <span class="type">char</span> *subsystem</code></em>,
60 <em class="parameter"><code>const <span class="type">char</span> *devtype</code></em>);
61 const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev-device.html#udev-device-get-devpath" title="udev_device_get_devpath ()">udev_device_get_devpath</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
62 const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev-device.html#udev-device-get-subsystem" title="udev_device_get_subsystem ()">udev_device_get_subsystem</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
63 const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev-device.html#udev-device-get-devtype" title="udev_device_get_devtype ()">udev_device_get_devtype</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
64 const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev-device.html#udev-device-get-syspath" title="udev_device_get_syspath ()">udev_device_get_syspath</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
65 const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev-device.html#udev-device-get-sysname" title="udev_device_get_sysname ()">udev_device_get_sysname</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
66 const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev-device.html#udev-device-get-sysnum" title="udev_device_get_sysnum ()">udev_device_get_sysnum</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
67 const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev-device.html#udev-device-get-devnode" title="udev_device_get_devnode ()">udev_device_get_devnode</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
68 <span class="returnvalue">int</span> <a class="link" href="libudev-udev-device.html#udev-device-get-is-initialized" title="udev_device_get_is_initialized ()">udev_device_get_is_initialized</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
69 struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-get-devlinks-list-entry" title="udev_device_get_devlinks_list_entry ()">udev_device_get_devlinks_list_entry</a>
70 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
71 struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-get-properties-list-entry" title="udev_device_get_properties_list_entry ()">udev_device_get_properties_list_entry</a>
72 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
73 struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-get-tags-list-entry" title="udev_device_get_tags_list_entry ()">udev_device_get_tags_list_entry</a>
74 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
75 const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev-device.html#udev-device-get-property-value" title="udev_device_get_property_value ()">udev_device_get_property_value</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
76 <em class="parameter"><code>const <span class="type">char</span> *key</code></em>);
77 const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev-device.html#udev-device-get-driver" title="udev_device_get_driver ()">udev_device_get_driver</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
78 <span class="returnvalue">dev_t</span> <a class="link" href="libudev-udev-device.html#udev-device-get-devnum" title="udev_device_get_devnum ()">udev_device_get_devnum</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
79 const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev-device.html#udev-device-get-action" title="udev_device_get_action ()">udev_device_get_action</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
80 const <span class="returnvalue">char</span> * <a class="link" href="libudev-udev-device.html#udev-device-get-sysattr-value" title="udev_device_get_sysattr_value ()">udev_device_get_sysattr_value</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
81 <em class="parameter"><code>const <span class="type">char</span> *sysattr</code></em>);
82 <span class="returnvalue">int</span> <a class="link" href="libudev-udev-device.html#udev-device-set-sysattr-value" title="udev_device_set_sysattr_value ()">udev_device_set_sysattr_value</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
83 <em class="parameter"><code>const <span class="type">char</span> *sysattr</code></em>,
84 <em class="parameter"><code><span class="type">char</span> *value</code></em>);
85 struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * <a class="link" href="libudev-udev-device.html#udev-device-get-sysattr-list-entry" title="udev_device_get_sysattr_list_entry ()">udev_device_get_sysattr_list_entry</a>
86 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
87 unsigned long long <span class="returnvalue">int</span> <a class="link" href="libudev-udev-device.html#udev-device-get-seqnum" title="udev_device_get_seqnum ()">udev_device_get_seqnum</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
88 unsigned long long <span class="returnvalue">int</span> <a class="link" href="libudev-udev-device.html#udev-device-get-usec-since-initialized" title="udev_device_get_usec_since_initialized ()">udev_device_get_usec_since_initialized</a>
89 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);
90 <span class="returnvalue">int</span> <a class="link" href="libudev-udev-device.html#udev-device-has-tag" title="udev_device_has_tag ()">udev_device_has_tag</a> (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
91 <em class="parameter"><code>const <span class="type">char</span> *tag</code></em>);
92 </pre>
93 </div>
94 <div class="refsect1">
95 <a name="libudev-udev-device.description"></a><h2>Description</h2>
96 <p>
97 Representation of kernel sys devices. Devices are uniquely identified
98 by their syspath, every device has exactly one path in the kernel sys
99 filesystem. Devices usually belong to a kernel subsystem, and and have
100 a unique name inside that subsystem.
101 </p>
102 </div>
103 <div class="refsect1">
104 <a name="libudev-udev-device.details"></a><h2>Details</h2>
105 <div class="refsect2">
106 <a name="udev-device"></a><h3>struct udev_device</h3>
107 <pre class="programlisting">struct udev_device;</pre>
108 <p>
109 Opaque object representing one kernel sys device.
110 </p>
111 </div>
112 <hr>
113 <div class="refsect2">
114 <a name="udev-device-ref"></a><h3>udev_device_ref ()</h3>
115 <pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_ref (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
116 <p>
117 Take a reference of a udev device.
118 </p>
119 <div class="variablelist"><table border="0" class="variablelist">
120 <colgroup>
121 <col align="left" valign="top">
122 <col>
123 </colgroup>
124 <tbody>
125 <tr>
126 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
127 <td>udev device</td>
128 </tr>
129 <tr>
130 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
131 <td>the passed udev device</td>
132 </tr>
133 </tbody>
134 </table></div>
135 </div>
136 <hr>
137 <div class="refsect2">
138 <a name="udev-device-unref"></a><h3>udev_device_unref ()</h3>
139 <pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_unref (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
140 <p>
141 Drop a reference of a udev device. If the refcount reaches zero,
142 the resources of the device will be released.
143 </p>
144 <div class="variablelist"><table border="0" class="variablelist">
145 <colgroup>
146 <col align="left" valign="top">
147 <col>
148 </colgroup>
149 <tbody>
150 <tr>
151 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
152 <td>udev device</td>
153 </tr>
154 <tr>
155 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
156 <td>the passed udev device if it has still an active reference, or <span class="type">NULL</span> otherwise.</td>
157 </tr>
158 </tbody>
159 </table></div>
160 </div>
161 <hr>
162 <div class="refsect2">
163 <a name="udev-device-get-udev"></a><h3>udev_device_get_udev ()</h3>
164 <pre class="programlisting">struct <a class="link" href="libudev-udev.html#udev" title="struct udev"><span class="returnvalue">udev</span></a> * udev_device_get_udev (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
165 <p>
166 Retrieve the udev library context the device was created with.
167 </p>
168 <div class="variablelist"><table border="0" class="variablelist">
169 <colgroup>
170 <col align="left" valign="top">
171 <col>
172 </colgroup>
173 <tbody>
174 <tr>
175 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
176 <td>udev device</td>
177 </tr>
178 <tr>
179 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
180 <td>the udev library context</td>
181 </tr>
182 </tbody>
183 </table></div>
184 </div>
185 <hr>
186 <div class="refsect2">
187 <a name="udev-device-new-from-syspath"></a><h3>udev_device_new_from_syspath ()</h3>
188 <pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_new_from_syspath (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
189 <em class="parameter"><code>const <span class="type">char</span> *syspath</code></em>);</pre>
190 <p>
191 Create new udev device, and fill in information from the sys
192 device and the udev database entry. The syspath is the absolute
193 path to the device, including the sys mount point.
194 </p>
195 <p>
196 The initial refcount is 1, and needs to be decremented to
197 release the resources of the udev device.
198 </p>
199 <div class="variablelist"><table border="0" class="variablelist">
200 <colgroup>
201 <col align="left" valign="top">
202 <col>
203 </colgroup>
204 <tbody>
205 <tr>
206 <td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
207 <td>udev library context</td>
208 </tr>
209 <tr>
210 <td><p><span class="term"><em class="parameter"><code>syspath</code></em> :</span></p></td>
211 <td>sys device path including sys directory</td>
212 </tr>
213 <tr>
214 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
215 <td>a new udev device, or <span class="type">NULL</span>, if it does not exist</td>
216 </tr>
217 </tbody>
218 </table></div>
219 </div>
220 <hr>
221 <div class="refsect2">
222 <a name="udev-device-new-from-devnum"></a><h3>udev_device_new_from_devnum ()</h3>
223 <pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_new_from_devnum (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
224 <em class="parameter"><code><span class="type">char</span> type</code></em>,
225 <em class="parameter"><code><span class="type">dev_t</span> devnum</code></em>);</pre>
226 <p>
227 Create new udev device, and fill in information from the sys
228 device and the udev database entry. The device is looked-up
229 by its major/minor number and type. Character and block device
230 numbers are not unique across the two types.
231 </p>
232 <p>
233 The initial refcount is 1, and needs to be decremented to
234 release the resources of the udev device.
235 </p>
236 <div class="variablelist"><table border="0" class="variablelist">
237 <colgroup>
238 <col align="left" valign="top">
239 <col>
240 </colgroup>
241 <tbody>
242 <tr>
243 <td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
244 <td>udev library context</td>
245 </tr>
246 <tr>
247 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
248 <td>char or block device</td>
249 </tr>
250 <tr>
251 <td><p><span class="term"><em class="parameter"><code>devnum</code></em> :</span></p></td>
252 <td>device major/minor number</td>
253 </tr>
254 <tr>
255 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
256 <td>a new udev device, or <span class="type">NULL</span>, if it does not exist</td>
257 </tr>
258 </tbody>
259 </table></div>
260 </div>
261 <hr>
262 <div class="refsect2">
263 <a name="udev-device-new-from-subsystem-sysname"></a><h3>udev_device_new_from_subsystem_sysname ()</h3>
264 <pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_new_from_subsystem_sysname
265 (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
266 <em class="parameter"><code>const <span class="type">char</span> *subsystem</code></em>,
267 <em class="parameter"><code>const <span class="type">char</span> *sysname</code></em>);</pre>
268 <p>
269 Create new udev device, and fill in information from the sys device
270 and the udev database entry. The device is looked up by the subsystem
271 and name string of the device, like "mem" / "zero", or "block" / "sda".
272 </p>
273 <p>
274 The initial refcount is 1, and needs to be decremented to
275 release the resources of the udev device.
276 </p>
277 <div class="variablelist"><table border="0" class="variablelist">
278 <colgroup>
279 <col align="left" valign="top">
280 <col>
281 </colgroup>
282 <tbody>
283 <tr>
284 <td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
285 <td>udev library context</td>
286 </tr>
287 <tr>
288 <td><p><span class="term"><em class="parameter"><code>subsystem</code></em> :</span></p></td>
289 <td>the subsystem of the device</td>
290 </tr>
291 <tr>
292 <td><p><span class="term"><em class="parameter"><code>sysname</code></em> :</span></p></td>
293 <td>the name of the device</td>
294 </tr>
295 <tr>
296 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
297 <td>a new udev device, or <span class="type">NULL</span>, if it does not exist</td>
298 </tr>
299 </tbody>
300 </table></div>
301 </div>
302 <hr>
303 <div class="refsect2">
304 <a name="udev-device-new-from-device-id"></a><h3>udev_device_new_from_device_id ()</h3>
305 <pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_new_from_device_id (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
306 <em class="parameter"><code><span class="type">char</span> *id</code></em>);</pre>
307 <p>
308 Create new udev device, and fill in information from the sys
309 device and the udev database entry. The device is looked-up
310 by a special string:
311 b8:2 - block device major:minor
312 c128:1 - char device major:minor
313 n3 - network device ifindex
314 +sound:card29 - kernel driver core subsystem:device name
315 </p>
316 <p>
317 The initial refcount is 1, and needs to be decremented to
318 release the resources of the udev device.
319 </p>
320 <div class="variablelist"><table border="0" class="variablelist">
321 <colgroup>
322 <col align="left" valign="top">
323 <col>
324 </colgroup>
325 <tbody>
326 <tr>
327 <td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
328 <td>udev library context</td>
329 </tr>
330 <tr>
331 <td><p><span class="term"><em class="parameter"><code>id</code></em> :</span></p></td>
332 <td>text string identifying a kernel device</td>
333 </tr>
334 <tr>
335 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
336 <td>a new udev device, or <span class="type">NULL</span>, if it does not exist</td>
337 </tr>
338 </tbody>
339 </table></div>
340 </div>
341 <hr>
342 <div class="refsect2">
343 <a name="udev-device-new-from-environment"></a><h3>udev_device_new_from_environment ()</h3>
344 <pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_new_from_environment (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);</pre>
345 <p>
346 Create new udev device, and fill in information from the
347 current process environment. This only works reliable if
348 the process is called from a udev rule. It is usually used
349 for tools executed from IMPORT= rules.
350 </p>
351 <p>
352 The initial refcount is 1, and needs to be decremented to
353 release the resources of the udev device.
354 </p>
355 <div class="variablelist"><table border="0" class="variablelist">
356 <colgroup>
357 <col align="left" valign="top">
358 <col>
359 </colgroup>
360 <tbody>
361 <tr>
362 <td><p><span class="term"><em class="parameter"><code>udev</code></em> :</span></p></td>
363 <td>udev library context</td>
364 </tr>
365 <tr>
366 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
367 <td>a new udev device, or <span class="type">NULL</span>, if it does not exist</td>
368 </tr>
369 </tbody>
370 </table></div>
371 </div>
372 <hr>
373 <div class="refsect2">
374 <a name="udev-device-get-parent"></a><h3>udev_device_get_parent ()</h3>
375 <pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_get_parent (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
376 <p>
377 Find the next parent device, and fill in information from the sys
378 device and the udev database entry.
379 </p>
380 <p>
381 The returned the device is not referenced. It is attached to the
382 child device, and will be cleaned up when the child device
383 is cleaned up.
384 </p>
385 <p>
386 It is not necessarily just the upper level directory, empty or not
387 recognized sys directories are ignored.
388 </p>
389 <p>
390 It can be called as many times as needed, without caring about
391 references.
392 </p>
393 <div class="variablelist"><table border="0" class="variablelist">
394 <colgroup>
395 <col align="left" valign="top">
396 <col>
397 </colgroup>
398 <tbody>
399 <tr>
400 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
401 <td>the device to start searching from</td>
402 </tr>
403 <tr>
404 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
405 <td>a new udev device, or <span class="type">NULL</span>, if it no parent exist.</td>
406 </tr>
407 </tbody>
408 </table></div>
409 </div>
410 <hr>
411 <div class="refsect2">
412 <a name="udev-device-get-parent-with-subsystem-devtype"></a><h3>udev_device_get_parent_with_subsystem_devtype ()</h3>
413 <pre class="programlisting">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> * udev_device_get_parent_with_subsystem_devtype
414 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
415 <em class="parameter"><code>const <span class="type">char</span> *subsystem</code></em>,
416 <em class="parameter"><code>const <span class="type">char</span> *devtype</code></em>);</pre>
417 <p>
418 Find the next parent device, with a matching subsystem and devtype
419 value, and fill in information from the sys device and the udev
420 database entry.
421 </p>
422 <p>
423 If devtype is <span class="type">NULL</span>, only subsystem is checked, and any devtype will
424 match.
425 </p>
426 <p>
427 The returned the device is not referenced. It is attached to the
428 child device, and will be cleaned up when the child device
429 is cleaned up.
430 </p>
431 <p>
432 It can be called as many times as needed, without caring about
433 references.
434 </p>
435 <div class="variablelist"><table border="0" class="variablelist">
436 <colgroup>
437 <col align="left" valign="top">
438 <col>
439 </colgroup>
440 <tbody>
441 <tr>
442 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
443 <td>udev device to start searching from</td>
444 </tr>
445 <tr>
446 <td><p><span class="term"><em class="parameter"><code>subsystem</code></em> :</span></p></td>
447 <td>the subsystem of the device</td>
448 </tr>
449 <tr>
450 <td><p><span class="term"><em class="parameter"><code>devtype</code></em> :</span></p></td>
451 <td>the type (DEVTYPE) of the device</td>
452 </tr>
453 <tr>
454 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
455 <td>a new udev device, or <span class="type">NULL</span> if no matching parent exists.</td>
456 </tr>
457 </tbody>
458 </table></div>
459 </div>
460 <hr>
461 <div class="refsect2">
462 <a name="udev-device-get-devpath"></a><h3>udev_device_get_devpath ()</h3>
463 <pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_devpath (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
464 <p>
465 Retrieve the kernel devpath value of the udev device. The path
466 does not contain the sys mount point, and starts with a '/'.
467 </p>
468 <div class="variablelist"><table border="0" class="variablelist">
469 <colgroup>
470 <col align="left" valign="top">
471 <col>
472 </colgroup>
473 <tbody>
474 <tr>
475 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
476 <td>udev device</td>
477 </tr>
478 <tr>
479 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
480 <td>the devpath of the udev device</td>
481 </tr>
482 </tbody>
483 </table></div>
484 </div>
485 <hr>
486 <div class="refsect2">
487 <a name="udev-device-get-subsystem"></a><h3>udev_device_get_subsystem ()</h3>
488 <pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_subsystem (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
489 <p>
490 Retrieve the subsystem string of the udev device. The string does not
491 contain any "/".
492 </p>
493 <div class="variablelist"><table border="0" class="variablelist">
494 <colgroup>
495 <col align="left" valign="top">
496 <col>
497 </colgroup>
498 <tbody>
499 <tr>
500 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
501 <td>udev device</td>
502 </tr>
503 <tr>
504 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
505 <td>the subsystem name of the udev device, or <span class="type">NULL</span> if it can not be determined</td>
506 </tr>
507 </tbody>
508 </table></div>
509 </div>
510 <hr>
511 <div class="refsect2">
512 <a name="udev-device-get-devtype"></a><h3>udev_device_get_devtype ()</h3>
513 <pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_devtype (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
514 <p>
515 Retrieve the devtype string of the udev device.
516 </p>
517 <div class="variablelist"><table border="0" class="variablelist">
518 <colgroup>
519 <col align="left" valign="top">
520 <col>
521 </colgroup>
522 <tbody>
523 <tr>
524 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
525 <td>udev device</td>
526 </tr>
527 <tr>
528 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
529 <td>the devtype name of the udev device, or <span class="type">NULL</span> if it can not be determined</td>
530 </tr>
531 </tbody>
532 </table></div>
533 </div>
534 <hr>
535 <div class="refsect2">
536 <a name="udev-device-get-syspath"></a><h3>udev_device_get_syspath ()</h3>
537 <pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_syspath (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
538 <p>
539 Retrieve the sys path of the udev device. The path is an
540 absolute path and starts with the sys mount point.
541 </p>
542 <div class="variablelist"><table border="0" class="variablelist">
543 <colgroup>
544 <col align="left" valign="top">
545 <col>
546 </colgroup>
547 <tbody>
548 <tr>
549 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
550 <td>udev device</td>
551 </tr>
552 <tr>
553 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
554 <td>the sys path of the udev device</td>
555 </tr>
556 </tbody>
557 </table></div>
558 </div>
559 <hr>
560 <div class="refsect2">
561 <a name="udev-device-get-sysname"></a><h3>udev_device_get_sysname ()</h3>
562 <pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_sysname (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
563 <p>
564 Get the kernel device name in /sys.
565 </p>
566 <div class="variablelist"><table border="0" class="variablelist">
567 <colgroup>
568 <col align="left" valign="top">
569 <col>
570 </colgroup>
571 <tbody>
572 <tr>
573 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
574 <td>udev device</td>
575 </tr>
576 <tr>
577 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
578 <td>the name string of the device device</td>
579 </tr>
580 </tbody>
581 </table></div>
582 </div>
583 <hr>
584 <div class="refsect2">
585 <a name="udev-device-get-sysnum"></a><h3>udev_device_get_sysnum ()</h3>
586 <pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_sysnum (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
587 <p>
588 Get the instance number of the device.
589 </p>
590 <div class="variablelist"><table border="0" class="variablelist">
591 <colgroup>
592 <col align="left" valign="top">
593 <col>
594 </colgroup>
595 <tbody>
596 <tr>
597 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
598 <td>udev device</td>
599 </tr>
600 <tr>
601 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
602 <td>the trailing number string of the device name</td>
603 </tr>
604 </tbody>
605 </table></div>
606 </div>
607 <hr>
608 <div class="refsect2">
609 <a name="udev-device-get-devnode"></a><h3>udev_device_get_devnode ()</h3>
610 <pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_devnode (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
611 <p>
612 Retrieve the device node file name belonging to the udev device.
613 The path is an absolute path, and starts with the device directory.
614 </p>
615 <div class="variablelist"><table border="0" class="variablelist">
616 <colgroup>
617 <col align="left" valign="top">
618 <col>
619 </colgroup>
620 <tbody>
621 <tr>
622 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
623 <td>udev device</td>
624 </tr>
625 <tr>
626 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
627 <td>the device node file name of the udev device, or <span class="type">NULL</span> if no device node exists</td>
628 </tr>
629 </tbody>
630 </table></div>
631 </div>
632 <hr>
633 <div class="refsect2">
634 <a name="udev-device-get-is-initialized"></a><h3>udev_device_get_is_initialized ()</h3>
635 <pre class="programlisting"><span class="returnvalue">int</span> udev_device_get_is_initialized (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
636 <p>
637 Check if udev has already handled the device and has set up
638 device node permissions and context, or has renamed a network
639 device.
640 </p>
641 <p>
642 This is only implemented for devices with a device node
643 or network interfaces. All other devices return 1 here.
644 </p>
645 <div class="variablelist"><table border="0" class="variablelist">
646 <colgroup>
647 <col align="left" valign="top">
648 <col>
649 </colgroup>
650 <tbody>
651 <tr>
652 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
653 <td>udev device</td>
654 </tr>
655 <tr>
656 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
657 <td>1 if the device is set up. 0 otherwise.</td>
658 </tr>
659 </tbody>
660 </table></div>
661 </div>
662 <hr>
663 <div class="refsect2">
664 <a name="udev-device-get-devlinks-list-entry"></a><h3>udev_device_get_devlinks_list_entry ()</h3>
665 <pre class="programlisting">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * udev_device_get_devlinks_list_entry
666 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
667 <p>
668 Retrieve the list of device links pointing to the device file of
669 the udev device. The next list entry can be retrieved with
670 <a class="link" href="libudev-udev-list.html#udev-list-entry-get-next" title="udev_list_entry_get_next ()"><code class="function">udev_list_entry_get_next()</code></a>, which returns <span class="type">NULL</span> if no more entries exist.
671 The devlink path can be retrieved from the list entry by
672 <a class="link" href="libudev-udev-list.html#udev-list-entry-get-name" title="udev_list_entry_get_name ()"><code class="function">udev_list_entry_get_name()</code></a>. The path is an absolute path, and starts with
673 the device directory.
674 </p>
675 <div class="variablelist"><table border="0" class="variablelist">
676 <colgroup>
677 <col align="left" valign="top">
678 <col>
679 </colgroup>
680 <tbody>
681 <tr>
682 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
683 <td>udev device</td>
684 </tr>
685 <tr>
686 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
687 <td>the first entry of the device node link list</td>
688 </tr>
689 </tbody>
690 </table></div>
691 </div>
692 <hr>
693 <div class="refsect2">
694 <a name="udev-device-get-properties-list-entry"></a><h3>udev_device_get_properties_list_entry ()</h3>
695 <pre class="programlisting">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * udev_device_get_properties_list_entry
696 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
697 <p>
698 Retrieve the list of key/value device properties of the udev
699 device. The next list entry can be retrieved with <a class="link" href="libudev-udev-list.html#udev-list-entry-get-next" title="udev_list_entry_get_next ()"><code class="function">udev_list_entry_get_next()</code></a>,
700 which returns <span class="type">NULL</span> if no more entries exist. The property name
701 can be retrieved from the list entry by <a class="link" href="libudev-udev-list.html#udev-list-entry-get-name" title="udev_list_entry_get_name ()"><code class="function">udev_list_entry_get_name()</code></a>,
702 the property value by <a class="link" href="libudev-udev-list.html#udev-list-entry-get-value" title="udev_list_entry_get_value ()"><code class="function">udev_list_entry_get_value()</code></a>.
703 </p>
704 <div class="variablelist"><table border="0" class="variablelist">
705 <colgroup>
706 <col align="left" valign="top">
707 <col>
708 </colgroup>
709 <tbody>
710 <tr>
711 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
712 <td>udev device</td>
713 </tr>
714 <tr>
715 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
716 <td>the first entry of the property list</td>
717 </tr>
718 </tbody>
719 </table></div>
720 </div>
721 <hr>
722 <div class="refsect2">
723 <a name="udev-device-get-tags-list-entry"></a><h3>udev_device_get_tags_list_entry ()</h3>
724 <pre class="programlisting">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * udev_device_get_tags_list_entry
725 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
726 <p>
727 Retrieve the list of tags attached to the udev device. The next
728 list entry can be retrieved with <a class="link" href="libudev-udev-list.html#udev-list-entry-get-next" title="udev_list_entry_get_next ()"><code class="function">udev_list_entry_get_next()</code></a>,
729 which returns <span class="type">NULL</span> if no more entries exist. The tag string
730 can be retrieved from the list entry by <a class="link" href="libudev-udev-list.html#udev-list-entry-get-name" title="udev_list_entry_get_name ()"><code class="function">udev_list_entry_get_name()</code></a>.
731 </p>
732 <div class="variablelist"><table border="0" class="variablelist">
733 <colgroup>
734 <col align="left" valign="top">
735 <col>
736 </colgroup>
737 <tbody>
738 <tr>
739 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
740 <td>udev device</td>
741 </tr>
742 <tr>
743 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
744 <td>the first entry of the tag list</td>
745 </tr>
746 </tbody>
747 </table></div>
748 </div>
749 <hr>
750 <div class="refsect2">
751 <a name="udev-device-get-property-value"></a><h3>udev_device_get_property_value ()</h3>
752 <pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_property_value (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
753 <em class="parameter"><code>const <span class="type">char</span> *key</code></em>);</pre>
754 <p>
755 Get the value of a given property.
756 </p>
757 <div class="variablelist"><table border="0" class="variablelist">
758 <colgroup>
759 <col align="left" valign="top">
760 <col>
761 </colgroup>
762 <tbody>
763 <tr>
764 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
765 <td>udev device</td>
766 </tr>
767 <tr>
768 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
769 <td>property name</td>
770 </tr>
771 <tr>
772 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
773 <td>the property string, or <span class="type">NULL</span> if there is no such property.</td>
774 </tr>
775 </tbody>
776 </table></div>
777 </div>
778 <hr>
779 <div class="refsect2">
780 <a name="udev-device-get-driver"></a><h3>udev_device_get_driver ()</h3>
781 <pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_driver (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
782 <p>
783 Get the kernel driver name.
784 </p>
785 <div class="variablelist"><table border="0" class="variablelist">
786 <colgroup>
787 <col align="left" valign="top">
788 <col>
789 </colgroup>
790 <tbody>
791 <tr>
792 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
793 <td>udev device</td>
794 </tr>
795 <tr>
796 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
797 <td>the driver name string, or <span class="type">NULL</span> if there is no driver attached.</td>
798 </tr>
799 </tbody>
800 </table></div>
801 </div>
802 <hr>
803 <div class="refsect2">
804 <a name="udev-device-get-devnum"></a><h3>udev_device_get_devnum ()</h3>
805 <pre class="programlisting"><span class="returnvalue">dev_t</span> udev_device_get_devnum (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
806 <p>
807 Get the device major/minor number.
808 </p>
809 <div class="variablelist"><table border="0" class="variablelist">
810 <colgroup>
811 <col align="left" valign="top">
812 <col>
813 </colgroup>
814 <tbody>
815 <tr>
816 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
817 <td>udev device</td>
818 </tr>
819 <tr>
820 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
821 <td>the dev_t number.</td>
822 </tr>
823 </tbody>
824 </table></div>
825 </div>
826 <hr>
827 <div class="refsect2">
828 <a name="udev-device-get-action"></a><h3>udev_device_get_action ()</h3>
829 <pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_action (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
830 <p>
831 This is only valid if the device was received through a monitor. Devices read from
832 sys do not have an action string. Usual actions are: add, remove, change, online,
833 offline.
834 </p>
835 <div class="variablelist"><table border="0" class="variablelist">
836 <colgroup>
837 <col align="left" valign="top">
838 <col>
839 </colgroup>
840 <tbody>
841 <tr>
842 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
843 <td>udev device</td>
844 </tr>
845 <tr>
846 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
847 <td>the kernel action value, or <span class="type">NULL</span> if there is no action value available.</td>
848 </tr>
849 </tbody>
850 </table></div>
851 </div>
852 <hr>
853 <div class="refsect2">
854 <a name="udev-device-get-sysattr-value"></a><h3>udev_device_get_sysattr_value ()</h3>
855 <pre class="programlisting">const <span class="returnvalue">char</span> * udev_device_get_sysattr_value (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
856 <em class="parameter"><code>const <span class="type">char</span> *sysattr</code></em>);</pre>
857 <p>
858 The retrieved value is cached in the device. Repeated calls will return the same
859 value and not open the attribute again.
860 </p>
861 <div class="variablelist"><table border="0" class="variablelist">
862 <colgroup>
863 <col align="left" valign="top">
864 <col>
865 </colgroup>
866 <tbody>
867 <tr>
868 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
869 <td>udev device</td>
870 </tr>
871 <tr>
872 <td><p><span class="term"><em class="parameter"><code>sysattr</code></em> :</span></p></td>
873 <td>attribute name</td>
874 </tr>
875 <tr>
876 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
877 <td>the content of a sys attribute file, or <span class="type">NULL</span> if there is no sys attribute value.</td>
878 </tr>
879 </tbody>
880 </table></div>
881 </div>
882 <hr>
883 <div class="refsect2">
884 <a name="udev-device-set-sysattr-value"></a><h3>udev_device_set_sysattr_value ()</h3>
885 <pre class="programlisting"><span class="returnvalue">int</span> udev_device_set_sysattr_value (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
886 <em class="parameter"><code>const <span class="type">char</span> *sysattr</code></em>,
887 <em class="parameter"><code><span class="type">char</span> *value</code></em>);</pre>
888 <p>
889 Update the contents of the sys attribute and the cached value of the device.
890 </p>
891 <div class="variablelist"><table border="0" class="variablelist">
892 <colgroup>
893 <col align="left" valign="top">
894 <col>
895 </colgroup>
896 <tbody>
897 <tr>
898 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
899 <td>udev device</td>
900 </tr>
901 <tr>
902 <td><p><span class="term"><em class="parameter"><code>sysattr</code></em> :</span></p></td>
903 <td>attribute name</td>
904 </tr>
905 <tr>
906 <td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
907 <td>new value to be set</td>
908 </tr>
909 <tr>
910 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
911 <td>Negative error code on failure or 0 on success.</td>
912 </tr>
913 </tbody>
914 </table></div>
915 </div>
916 <hr>
917 <div class="refsect2">
918 <a name="udev-device-get-sysattr-list-entry"></a><h3>udev_device_get_sysattr_list_entry ()</h3>
919 <pre class="programlisting">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> * udev_device_get_sysattr_list_entry
920 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
921 <p>
922 Retrieve the list of available sysattrs, with value being empty;
923 This just return all available sysfs attributes for a particular
924 device without reading their values.
925 </p>
926 <div class="variablelist"><table border="0" class="variablelist">
927 <colgroup>
928 <col align="left" valign="top">
929 <col>
930 </colgroup>
931 <tbody>
932 <tr>
933 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
934 <td>udev device</td>
935 </tr>
936 <tr>
937 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
938 <td>the first entry of the property list</td>
939 </tr>
940 </tbody>
941 </table></div>
942 </div>
943 <hr>
944 <div class="refsect2">
945 <a name="udev-device-get-seqnum"></a><h3>udev_device_get_seqnum ()</h3>
946 <pre class="programlisting">unsigned long long <span class="returnvalue">int</span> udev_device_get_seqnum (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
947 <p>
948 This is only valid if the device was received through a monitor. Devices read from
949 sys do not have a sequence number.
950 </p>
951 <div class="variablelist"><table border="0" class="variablelist">
952 <colgroup>
953 <col align="left" valign="top">
954 <col>
955 </colgroup>
956 <tbody>
957 <tr>
958 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
959 <td>udev device</td>
960 </tr>
961 <tr>
962 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
963 <td>the kernel event sequence number, or 0 if there is no sequence number available.</td>
964 </tr>
965 </tbody>
966 </table></div>
967 </div>
968 <hr>
969 <div class="refsect2">
970 <a name="udev-device-get-usec-since-initialized"></a><h3>udev_device_get_usec_since_initialized ()</h3>
971 <pre class="programlisting">unsigned long long <span class="returnvalue">int</span> udev_device_get_usec_since_initialized
972 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
973 <p>
974 Return the number of microseconds passed since udev set up the
975 device for the first time.
976 </p>
977 <p>
978 This is only implemented for devices with need to store properties
979 in the udev database. All other devices return 0 here.
980 </p>
981 <div class="variablelist"><table border="0" class="variablelist">
982 <colgroup>
983 <col align="left" valign="top">
984 <col>
985 </colgroup>
986 <tbody>
987 <tr>
988 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
989 <td>udev device</td>
990 </tr>
991 <tr>
992 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
993 <td>the number of microseconds since the device was first seen.</td>
994 </tr>
995 </tbody>
996 </table></div>
997 </div>
998 <hr>
999 <div class="refsect2">
1000 <a name="udev-device-has-tag"></a><h3>udev_device_has_tag ()</h3>
1001 <pre class="programlisting"><span class="returnvalue">int</span> udev_device_has_tag (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
1002 <em class="parameter"><code>const <span class="type">char</span> *tag</code></em>);</pre>
1003 <p>
1004 Check if a given device has a certain tag associated.
1005 </p>
1006 <div class="variablelist"><table border="0" class="variablelist">
1007 <colgroup>
1008 <col align="left" valign="top">
1009 <col>
1010 </colgroup>
1011 <tbody>
1012 <tr>
1013 <td><p><span class="term"><em class="parameter"><code>udev_device</code></em> :</span></p></td>
1014 <td>udev device</td>
1015 </tr>
1016 <tr>
1017 <td><p><span class="term"><em class="parameter"><code>tag</code></em> :</span></p></td>
1018 <td>tag name</td>
1019 </tr>
1020 <tr>
1021 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1022 <td>1 if the tag is found. 0 otherwise.</td>
1023 </tr>
1024 </tbody>
1025 </table></div>
1026 </div>
1027 </div>
1028 </div>
1029 <div class="footer">
1030 <hr>
1031 Generated by GTK-Doc V1.18</div>
1032 </body>
1033 </html>