mirror of
https://git.proxmox.com/git/systemd
synced 2025-05-25 16:38:12 +00:00
1308 lines
55 KiB
HTML
1308 lines
55 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||
<title>libudev Reference Manual: udev_device</title>
|
||
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
|
||
<link rel="home" href="index.html" title="libudev Reference Manual">
|
||
<link rel="up" href="ch01.html" title="API Reference">
|
||
<link rel="prev" href="libudev-udev-list.html" title="udev_list">
|
||
<link rel="next" href="libudev-udev-monitor.html" title="udev_monitor">
|
||
<meta name="generator" content="GTK-Doc V1.21 (XML mode)">
|
||
<link rel="stylesheet" href="style.css" type="text/css">
|
||
</head>
|
||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
|
||
<td width="100%" align="left" class="shortcuts">
|
||
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
|
||
<a href="#libudev-udev-device.description" class="shortcut">Description</a></span>
|
||
</td>
|
||
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
|
||
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
|
||
<td><a accesskey="p" href="libudev-udev-list.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
|
||
<td><a accesskey="n" href="libudev-udev-monitor.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
|
||
</tr></table>
|
||
<div class="refentry">
|
||
<a name="libudev-udev-device"></a><div class="titlepage"></div>
|
||
<div class="refnamediv"><table width="100%"><tr>
|
||
<td valign="top">
|
||
<h2><span class="refentrytitle"><a name="libudev-udev-device.top_of_page"></a>udev_device</span></h2>
|
||
<p>udev_device — kernel sys devices</p>
|
||
</td>
|
||
<td class="gallery_image" valign="top" align="right"></td>
|
||
</tr></table></div>
|
||
<div class="refsect1">
|
||
<a name="libudev-udev-device.functions"></a><h2>Functions</h2>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="functions_return">
|
||
<col class="functions_name">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="function_type">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-ref" title="udev_device_ref ()">udev_device_ref</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-unref" title="udev_device_unref ()">udev_device_unref</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">struct <a class="link" href="libudev-udev.html#udev" title="struct udev"><span class="returnvalue">udev</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-get-udev" title="udev_device_get_udev ()">udev_device_get_udev</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-get-parent" title="udev_device_get_parent ()">udev_device_get_parent</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">struct <a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device"><span class="returnvalue">udev_device</span></a> *
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">const <span class="returnvalue">char</span> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-get-devpath" title="udev_device_get_devpath ()">udev_device_get_devpath</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">const <span class="returnvalue">char</span> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-get-subsystem" title="udev_device_get_subsystem ()">udev_device_get_subsystem</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">const <span class="returnvalue">char</span> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-get-devtype" title="udev_device_get_devtype ()">udev_device_get_devtype</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">const <span class="returnvalue">char</span> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-get-syspath" title="udev_device_get_syspath ()">udev_device_get_syspath</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">const <span class="returnvalue">char</span> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-get-sysname" title="udev_device_get_sysname ()">udev_device_get_sysname</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">const <span class="returnvalue">char</span> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-get-sysnum" title="udev_device_get_sysnum ()">udev_device_get_sysnum</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">const <span class="returnvalue">char</span> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-get-devnode" title="udev_device_get_devnode ()">udev_device_get_devnode</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">int</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">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> *
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">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> *
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">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> *
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">const <span class="returnvalue">char</span> *
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">const <span class="returnvalue">char</span> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-get-driver" title="udev_device_get_driver ()">udev_device_get_driver</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">dev_t</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-get-devnum" title="udev_device_get_devnum ()">udev_device_get_devnum</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">const <span class="returnvalue">char</span> *
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-get-action" title="udev_device_get_action ()">udev_device_get_action</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">const <span class="returnvalue">char</span> *
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">int</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">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> *
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">unsigned long long <span class="returnvalue">int</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-get-seqnum" title="udev_device_get_seqnum ()">udev_device_get_seqnum</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">unsigned long long <span class="returnvalue">int</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<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> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="function_type">
|
||
<span class="returnvalue">int</span>
|
||
</td>
|
||
<td class="function_name">
|
||
<a class="link" href="libudev-udev-device.html#udev-device-has-tag" title="udev_device_has_tag ()">udev_device_has_tag</a> <span class="c_punctuation">()</span>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="libudev-udev-device.other"></a><h2>Types and Values</h2>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="name">
|
||
<col class="description">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="datatype_keyword">struct</td>
|
||
<td class="function_name"><a class="link" href="libudev-udev-device.html#udev-device" title="struct udev_device">udev_device</a></td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="libudev-udev-device.description"></a><h2>Description</h2>
|
||
<p>Representation of kernel sys devices. Devices are uniquely identified
|
||
by their syspath, every device has exactly one path in the kernel sys
|
||
filesystem. Devices usually belong to a kernel subsystem, and have
|
||
a unique name inside that subsystem.</p>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="libudev-udev-device.functions_details"></a><h2>Functions</h2>
|
||
<div class="refsect2">
|
||
<a name="udev-device-ref"></a><h3>udev_device_ref ()</h3>
|
||
<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>
|
||
<p>Take a reference of a udev device.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.2.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.2.6"></a><h4>Returns</h4>
|
||
<p> the passed udev device</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-unref"></a><h3>udev_device_unref ()</h3>
|
||
<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>
|
||
<p>Drop a reference of a udev device. If the refcount reaches zero,
|
||
the resources of the device will be released.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.3.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.3.6"></a><h4>Returns</h4>
|
||
<p> <span class="type">NULL</span></p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-udev"></a><h3>udev_device_get_udev ()</h3>
|
||
<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>
|
||
<p>Retrieve the udev library context the device was created with.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.4.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.4.6"></a><h4>Returns</h4>
|
||
<p> the udev library context</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-new-from-syspath"></a><h3>udev_device_new_from_syspath ()</h3>
|
||
<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>,
|
||
<em class="parameter"><code>const <span class="type">char</span> *syspath</code></em>);</pre>
|
||
<p>Create new udev device, and fill in information from the sys
|
||
device and the udev database entry. The syspath is the absolute
|
||
path to the device, including the sys mount point.</p>
|
||
<p>The initial refcount is 1, and needs to be decremented to
|
||
release the resources of the udev device.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.5.6"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>udev</p></td>
|
||
<td class="parameter_description"><p>udev library context</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>syspath</p></td>
|
||
<td class="parameter_description"><p>sys device path including sys directory</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.5.7"></a><h4>Returns</h4>
|
||
<p> a new udev device, or <span class="type">NULL</span>, if it does not exist</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-new-from-devnum"></a><h3>udev_device_new_from_devnum ()</h3>
|
||
<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>,
|
||
<em class="parameter"><code><span class="type">char</span> type</code></em>,
|
||
<em class="parameter"><code><span class="type">dev_t</span> devnum</code></em>);</pre>
|
||
<p>Create new udev device, and fill in information from the sys
|
||
device and the udev database entry. The device is looked-up
|
||
by its major/minor number and type. Character and block device
|
||
numbers are not unique across the two types.</p>
|
||
<p>The initial refcount is 1, and needs to be decremented to
|
||
release the resources of the udev device.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.6.6"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>udev</p></td>
|
||
<td class="parameter_description"><p>udev library context</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>type</p></td>
|
||
<td class="parameter_description"><p>char or block device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>devnum</p></td>
|
||
<td class="parameter_description"><p>device major/minor number</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.6.7"></a><h4>Returns</h4>
|
||
<p> a new udev device, or <span class="type">NULL</span>, if it does not exist</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-new-from-subsystem-sysname"></a><h3>udev_device_new_from_subsystem_sysname ()</h3>
|
||
<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
|
||
(<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>,
|
||
<em class="parameter"><code>const <span class="type">char</span> *subsystem</code></em>,
|
||
<em class="parameter"><code>const <span class="type">char</span> *sysname</code></em>);</pre>
|
||
<p>Create new udev device, and fill in information from the sys device
|
||
and the udev database entry. The device is looked up by the subsystem
|
||
and name string of the device, like "mem" / "zero", or "block" / "sda".</p>
|
||
<p>The initial refcount is 1, and needs to be decremented to
|
||
release the resources of the udev device.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.7.6"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>udev</p></td>
|
||
<td class="parameter_description"><p>udev library context</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>subsystem</p></td>
|
||
<td class="parameter_description"><p>the subsystem of the device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>sysname</p></td>
|
||
<td class="parameter_description"><p>the name of the device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.7.7"></a><h4>Returns</h4>
|
||
<p> a new udev device, or <span class="type">NULL</span>, if it does not exist</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-new-from-device-id"></a><h3>udev_device_new_from_device_id ()</h3>
|
||
<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>,
|
||
<em class="parameter"><code>const <span class="type">char</span> *id</code></em>);</pre>
|
||
<p>Create new udev device, and fill in information from the sys
|
||
device and the udev database entry. The device is looked-up
|
||
by a special string:
|
||
b8:2 - block device major:minor
|
||
c128:1 - char device major:minor
|
||
n3 - network device ifindex
|
||
+sound:card29 - kernel driver core subsystem:device name</p>
|
||
<p>The initial refcount is 1, and needs to be decremented to
|
||
release the resources of the udev device.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.8.6"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>udev</p></td>
|
||
<td class="parameter_description"><p>udev library context</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>id</p></td>
|
||
<td class="parameter_description"><p>text string identifying a kernel device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.8.7"></a><h4>Returns</h4>
|
||
<p> a new udev device, or <span class="type">NULL</span>, if it does not exist</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-new-from-environment"></a><h3>udev_device_new_from_environment ()</h3>
|
||
<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>
|
||
<p>Create new udev device, and fill in information from the
|
||
current process environment. This only works reliable if
|
||
the process is called from a udev rule. It is usually used
|
||
for tools executed from IMPORT= rules.</p>
|
||
<p>The initial refcount is 1, and needs to be decremented to
|
||
release the resources of the udev device.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.9.6"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev</p></td>
|
||
<td class="parameter_description"><p>udev library context</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.9.7"></a><h4>Returns</h4>
|
||
<p> a new udev device, or <span class="type">NULL</span>, if it does not exist</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-parent"></a><h3>udev_device_get_parent ()</h3>
|
||
<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>
|
||
<p>Find the next parent device, and fill in information from the sys
|
||
device and the udev database entry.</p>
|
||
<p>Returned device is not referenced. It is attached to the child
|
||
device, and will be cleaned up when the child device is cleaned up.</p>
|
||
<p>It is not necessarily just the upper level directory, empty or not
|
||
recognized sys directories are ignored.</p>
|
||
<p>It can be called as many times as needed, without caring about
|
||
references.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.10.8"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>the device to start searching from</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.10.9"></a><h4>Returns</h4>
|
||
<p> a new udev device, or <span class="type">NULL</span>, if it no parent exist.</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-parent-with-subsystem-devtype"></a><h3>udev_device_get_parent_with_subsystem_devtype ()</h3>
|
||
<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
|
||
(<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>,
|
||
<em class="parameter"><code>const <span class="type">char</span> *subsystem</code></em>,
|
||
<em class="parameter"><code>const <span class="type">char</span> *devtype</code></em>);</pre>
|
||
<p>Find the next parent device, with a matching subsystem and devtype
|
||
value, and fill in information from the sys device and the udev
|
||
database entry.</p>
|
||
<p>If devtype is <span class="type">NULL</span>, only subsystem is checked, and any devtype will
|
||
match.</p>
|
||
<p>Returned device is not referenced. It is attached to the child
|
||
device, and will be cleaned up when the child device is cleaned up.</p>
|
||
<p>It can be called as many times as needed, without caring about
|
||
references.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.11.8"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device to start searching from</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>subsystem</p></td>
|
||
<td class="parameter_description"><p>the subsystem of the device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>devtype</p></td>
|
||
<td class="parameter_description"><p>the type (DEVTYPE) of the device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.11.9"></a><h4>Returns</h4>
|
||
<p> a new udev device, or <span class="type">NULL</span> if no matching parent exists.</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-devpath"></a><h3>udev_device_get_devpath ()</h3>
|
||
<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>
|
||
<p>Retrieve the kernel devpath value of the udev device. The path
|
||
does not contain the sys mount point, and starts with a '/'.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.12.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.12.6"></a><h4>Returns</h4>
|
||
<p> the devpath of the udev device</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-subsystem"></a><h3>udev_device_get_subsystem ()</h3>
|
||
<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>
|
||
<p>Retrieve the subsystem string of the udev device. The string does not
|
||
contain any "/".</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.13.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.13.6"></a><h4>Returns</h4>
|
||
<p> the subsystem name of the udev device, or <span class="type">NULL</span> if it can not be determined</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-devtype"></a><h3>udev_device_get_devtype ()</h3>
|
||
<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>
|
||
<p>Retrieve the devtype string of the udev device.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.14.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.14.6"></a><h4>Returns</h4>
|
||
<p> the devtype name of the udev device, or <span class="type">NULL</span> if it can not be determined</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-syspath"></a><h3>udev_device_get_syspath ()</h3>
|
||
<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>
|
||
<p>Retrieve the sys path of the udev device. The path is an
|
||
absolute path and starts with the sys mount point.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.15.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.15.6"></a><h4>Returns</h4>
|
||
<p> the sys path of the udev device</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-sysname"></a><h3>udev_device_get_sysname ()</h3>
|
||
<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>
|
||
<p>Get the kernel device name in /sys.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.16.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.16.6"></a><h4>Returns</h4>
|
||
<p> the name string of the device device</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-sysnum"></a><h3>udev_device_get_sysnum ()</h3>
|
||
<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>
|
||
<p>Get the instance number of the device.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.17.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.17.6"></a><h4>Returns</h4>
|
||
<p> the trailing number string of the device name</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-devnode"></a><h3>udev_device_get_devnode ()</h3>
|
||
<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>
|
||
<p>Retrieve the device node file name belonging to the udev device.
|
||
The path is an absolute path, and starts with the device directory.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.18.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.18.6"></a><h4>Returns</h4>
|
||
<p> the device node file name of the udev device, or <span class="type">NULL</span> if no device node exists</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-is-initialized"></a><h3>udev_device_get_is_initialized ()</h3>
|
||
<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>
|
||
<p>Check if udev has already handled the device and has set up
|
||
device node permissions and context, or has renamed a network
|
||
device.</p>
|
||
<p>This is only implemented for devices with a device node
|
||
or network interfaces. All other devices return 1 here.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.19.6"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.19.7"></a><h4>Returns</h4>
|
||
<p> 1 if the device is set up. 0 otherwise.</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-devlinks-list-entry"></a><h3>udev_device_get_devlinks_list_entry ()</h3>
|
||
<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 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
|
||
<p>Retrieve the list of device links pointing to the device file of
|
||
the udev 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>, which returns <span class="type">NULL</span> if no more entries exist.
|
||
The devlink path 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>. The path is an absolute path, and starts with
|
||
the device directory.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.20.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.20.6"></a><h4>Returns</h4>
|
||
<p> the first entry of the device node link list</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-properties-list-entry"></a><h3>udev_device_get_properties_list_entry ()</h3>
|
||
<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 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
|
||
<p>Retrieve the list of key/value device properties of the udev
|
||
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>,
|
||
which returns <span class="type">NULL</span> if no more entries exist. The property name
|
||
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>,
|
||
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>.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.21.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.21.6"></a><h4>Returns</h4>
|
||
<p> the first entry of the property list</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-tags-list-entry"></a><h3>udev_device_get_tags_list_entry ()</h3>
|
||
<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 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
|
||
<p>Retrieve the list of tags attached to the udev 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>,
|
||
which returns <span class="type">NULL</span> if no more entries exist. The tag string
|
||
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>.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.22.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.22.6"></a><h4>Returns</h4>
|
||
<p> the first entry of the tag list</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-property-value"></a><h3>udev_device_get_property_value ()</h3>
|
||
<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>,
|
||
<em class="parameter"><code>const <span class="type">char</span> *key</code></em>);</pre>
|
||
<p>Get the value of a given property.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.23.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>key</p></td>
|
||
<td class="parameter_description"><p>property name</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.23.6"></a><h4>Returns</h4>
|
||
<p> the property string, or <span class="type">NULL</span> if there is no such property.</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-driver"></a><h3>udev_device_get_driver ()</h3>
|
||
<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>
|
||
<p>Get the kernel driver name.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.24.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.24.6"></a><h4>Returns</h4>
|
||
<p> the driver name string, or <span class="type">NULL</span> if there is no driver attached.</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-devnum"></a><h3>udev_device_get_devnum ()</h3>
|
||
<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>
|
||
<p>Get the device major/minor number.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.25.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.25.6"></a><h4>Returns</h4>
|
||
<p> the dev_t number.</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-action"></a><h3>udev_device_get_action ()</h3>
|
||
<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>
|
||
<p>This is only valid if the device was received through a monitor. Devices read from
|
||
sys do not have an action string. Usual actions are: add, remove, change, online,
|
||
offline.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.26.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.26.6"></a><h4>Returns</h4>
|
||
<p> the kernel action value, or <span class="type">NULL</span> if there is no action value available.</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-sysattr-value"></a><h3>udev_device_get_sysattr_value ()</h3>
|
||
<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>,
|
||
<em class="parameter"><code>const <span class="type">char</span> *sysattr</code></em>);</pre>
|
||
<p>The retrieved value is cached in the device. Repeated calls will return the same
|
||
value and not open the attribute again.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.27.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>sysattr</p></td>
|
||
<td class="parameter_description"><p>attribute name</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.27.6"></a><h4>Returns</h4>
|
||
<p> the content of a sys attribute file, or <span class="type">NULL</span> if there is no sys attribute value.</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-set-sysattr-value"></a><h3>udev_device_set_sysattr_value ()</h3>
|
||
<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>,
|
||
<em class="parameter"><code>const <span class="type">char</span> *sysattr</code></em>,
|
||
<em class="parameter"><code><span class="type">char</span> *value</code></em>);</pre>
|
||
<p>Update the contents of the sys attribute and the cached value of the device.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.28.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>sysattr</p></td>
|
||
<td class="parameter_description"><p>attribute name</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>value</p></td>
|
||
<td class="parameter_description"><p>new value to be set</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.28.6"></a><h4>Returns</h4>
|
||
<p> Negative error code on failure or 0 on success.</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-sysattr-list-entry"></a><h3>udev_device_get_sysattr_list_entry ()</h3>
|
||
<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 (<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
|
||
<p>Retrieve the list of available sysattrs, with value being empty;
|
||
This just return all available sysfs attributes for a particular
|
||
device without reading their values.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.29.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.29.6"></a><h4>Returns</h4>
|
||
<p> the first entry of the property list</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-seqnum"></a><h3>udev_device_get_seqnum ()</h3>
|
||
<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>
|
||
<p>This is only valid if the device was received through a monitor. Devices read from
|
||
sys do not have a sequence number.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.30.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.30.6"></a><h4>Returns</h4>
|
||
<p> the kernel event sequence number, or 0 if there is no sequence number available.</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-get-usec-since-initialized"></a><h3>udev_device_get_usec_since_initialized ()</h3>
|
||
<pre class="programlisting">unsigned long long <span class="returnvalue">int</span>
|
||
udev_device_get_usec_since_initialized
|
||
(<em class="parameter"><code><span class="type">struct udev_device</span> *udev_device</code></em>);</pre>
|
||
<p>Return the number of microseconds passed since udev set up the
|
||
device for the first time.</p>
|
||
<p>This is only implemented for devices with need to store properties
|
||
in the udev database. All other devices return 0 here.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.31.6"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody><tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr></tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.31.7"></a><h4>Returns</h4>
|
||
<p> the number of microseconds since the device was first seen.</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
<hr>
|
||
<div class="refsect2">
|
||
<a name="udev-device-has-tag"></a><h3>udev_device_has_tag ()</h3>
|
||
<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>,
|
||
<em class="parameter"><code>const <span class="type">char</span> *tag</code></em>);</pre>
|
||
<p>Check if a given device has a certain tag associated.</p>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.32.5"></a><h4>Parameters</h4>
|
||
<div class="informaltable"><table width="100%" border="0">
|
||
<colgroup>
|
||
<col width="150px" class="parameters_name">
|
||
<col class="parameters_description">
|
||
<col width="200px" class="parameters_annotations">
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="parameter_name"><p>udev_device</p></td>
|
||
<td class="parameter_description"><p>udev device</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
<tr>
|
||
<td class="parameter_name"><p>tag</p></td>
|
||
<td class="parameter_description"><p>tag name</p></td>
|
||
<td class="parameter_annotations"> </td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<div class="refsect3">
|
||
<a name="id-1.2.4.6.32.6"></a><h4>Returns</h4>
|
||
<p> 1 if the tag is found. 0 otherwise.</p>
|
||
<p></p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="refsect1">
|
||
<a name="libudev-udev-device.other_details"></a><h2>Types and Values</h2>
|
||
<div class="refsect2">
|
||
<a name="udev-device"></a><h3>struct udev_device</h3>
|
||
<pre class="programlisting">struct udev_device;</pre>
|
||
<p>Opaque object representing one kernel sys device.</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="footer">
|
||
<hr>
|
||
Generated by GTK-Doc V1.21</div>
|
||
</body>
|
||
</html> |