| 1 |
<?xml version='1.0'?> <!--*-nxml-*--> |
| 2 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ |
| 4 |
<!ENTITY % entities SYSTEM "custom-entities.ent" > |
| 5 |
%entities; |
| 6 |
]> |
| 7 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 8 |
|
| 9 |
<refentry id="udev_device_get_syspath" |
| 10 |
xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 11 |
|
| 12 |
<refentryinfo> |
| 13 |
<title>udev_device_get_syspath</title> |
| 14 |
<productname>systemd</productname> |
| 15 |
</refentryinfo> |
| 16 |
|
| 17 |
<refmeta> |
| 18 |
<refentrytitle>udev_device_get_syspath</refentrytitle> |
| 19 |
<manvolnum>3</manvolnum> |
| 20 |
</refmeta> |
| 21 |
|
| 22 |
<refnamediv> |
| 23 |
<refname>udev_device_get_syspath</refname> |
| 24 |
<refname>udev_device_get_sysname</refname> |
| 25 |
<refname>udev_device_get_sysnum</refname> |
| 26 |
<refname>udev_device_get_devpath</refname> |
| 27 |
<refname>udev_device_get_devnode</refname> |
| 28 |
<refname>udev_device_get_devnum</refname> |
| 29 |
<refname>udev_device_get_devtype</refname> |
| 30 |
<refname>udev_device_get_subsystem</refname> |
| 31 |
<refname>udev_device_get_driver</refname> |
| 32 |
<refname>udev_device_get_udev</refname> |
| 33 |
<refname>udev_device_get_parent</refname> |
| 34 |
<refname>udev_device_get_parent_with_subsystem_devtype</refname> |
| 35 |
<refname>udev_device_get_is_initialized</refname> |
| 36 |
<refname>udev_device_get_action</refname> |
| 37 |
|
| 38 |
<refpurpose>Query device properties</refpurpose> |
| 39 |
</refnamediv> |
| 40 |
|
| 41 |
<refsynopsisdiv> |
| 42 |
<funcsynopsis> |
| 43 |
<funcsynopsisinfo>#include <libudev.h></funcsynopsisinfo> |
| 44 |
|
| 45 |
<funcprototype> |
| 46 |
<funcdef>const char *<function>udev_device_get_syspath</function></funcdef> |
| 47 |
<paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> |
| 48 |
</funcprototype> |
| 49 |
|
| 50 |
<funcprototype> |
| 51 |
<funcdef>const char *<function>udev_device_get_sysname</function></funcdef> |
| 52 |
<paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> |
| 53 |
</funcprototype> |
| 54 |
|
| 55 |
<funcprototype> |
| 56 |
<funcdef>const char *<function>udev_device_get_sysnum</function></funcdef> |
| 57 |
<paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> |
| 58 |
</funcprototype> |
| 59 |
|
| 60 |
<funcprototype> |
| 61 |
<funcdef>const char *<function>udev_device_get_devpath</function></funcdef> |
| 62 |
<paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> |
| 63 |
</funcprototype> |
| 64 |
|
| 65 |
<funcprototype> |
| 66 |
<funcdef>const char *<function>udev_device_get_devnode</function></funcdef> |
| 67 |
<paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> |
| 68 |
</funcprototype> |
| 69 |
|
| 70 |
<funcprototype> |
| 71 |
<funcdef>dev_t <function>udev_device_get_devnum</function></funcdef> |
| 72 |
<paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> |
| 73 |
</funcprototype> |
| 74 |
|
| 75 |
<funcprototype> |
| 76 |
<funcdef>const char *<function>udev_device_get_devtype</function></funcdef> |
| 77 |
<paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> |
| 78 |
</funcprototype> |
| 79 |
|
| 80 |
<funcprototype> |
| 81 |
<funcdef>const char *<function>udev_device_get_subsystem</function></funcdef> |
| 82 |
<paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> |
| 83 |
</funcprototype> |
| 84 |
|
| 85 |
<funcprototype> |
| 86 |
<funcdef>const char *<function>udev_device_get_driver</function></funcdef> |
| 87 |
<paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> |
| 88 |
</funcprototype> |
| 89 |
|
| 90 |
<funcprototype> |
| 91 |
<funcdef>struct udev *<function>udev_device_get_udev</function></funcdef> |
| 92 |
<paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> |
| 93 |
</funcprototype> |
| 94 |
|
| 95 |
<funcprototype> |
| 96 |
<funcdef>struct udev_device *<function>udev_device_get_parent</function></funcdef> |
| 97 |
<paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> |
| 98 |
</funcprototype> |
| 99 |
|
| 100 |
<funcprototype> |
| 101 |
<funcdef>struct udev_device *<function>udev_device_get_parent_with_subsystem_devtype</function></funcdef> |
| 102 |
<paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> |
| 103 |
<paramdef>const char *<parameter>subsystem</parameter></paramdef> |
| 104 |
<paramdef>const char *<parameter>devtype</parameter></paramdef> |
| 105 |
</funcprototype> |
| 106 |
|
| 107 |
<funcprototype> |
| 108 |
<funcdef>int <function>udev_device_get_is_initialized</function></funcdef> |
| 109 |
<paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> |
| 110 |
</funcprototype> |
| 111 |
|
| 112 |
<funcprototype> |
| 113 |
<funcdef>const char *<function>udev_device_get_action</function></funcdef> |
| 114 |
<paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> |
| 115 |
</funcprototype> |
| 116 |
|
| 117 |
</funcsynopsis> |
| 118 |
</refsynopsisdiv> |
| 119 |
|
| 120 |
<!--<refsect1> |
| 121 |
<title>Description</title> |
| 122 |
|
| 123 |
<para>XXX: Add documentation.</para> |
| 124 |
</refsect1>--> |
| 125 |
|
| 126 |
<refsect1> |
| 127 |
<title>Return Value</title> |
| 128 |
|
| 129 |
<para>On success, <function>udev_device_get_syspath()</function>, |
| 130 |
<function>udev_device_get_sysname()</function>, |
| 131 |
<function>udev_device_get_sysnum()</function>, |
| 132 |
<function>udev_device_get_devpath()</function>, |
| 133 |
<function>udev_device_get_devnode()</function>, |
| 134 |
<function>udev_device_get_devtype()</function>, |
| 135 |
<function>udev_device_get_subsystem()</function>, |
| 136 |
<function>udev_device_get_driver()</function> and |
| 137 |
<function>udev_device_get_action()</function> return a pointer |
| 138 |
to a constant string that describes the requested property. The |
| 139 |
lifetime of this string is bound to the device it was requested |
| 140 |
on. On failure, each function may return |
| 141 |
<constant>NULL</constant>.</para> |
| 142 |
|
| 143 |
<para>On success, <function>udev_device_get_devnum()</function> |
| 144 |
returns the device type of the passed device. On failure, a |
| 145 |
device type with minor and major number set to |
| 146 |
<constant>0</constant> is returned.</para> |
| 147 |
|
| 148 |
<para><function>udev_device_get_udev()</function> always returns |
| 149 |
a valid pointer to the udev context that this device belongs |
| 150 |
to.</para> |
| 151 |
|
| 152 |
<para>On success, <function>udev_device_get_parent()</function> |
| 153 |
and |
| 154 |
<function>udev_device_get_parent_with_subsystem_devtype()</function> |
| 155 |
return a pointer to the parent device. No additional reference |
| 156 |
to this device is acquired, but the child device owns a reference |
| 157 |
to such a parent device. On failure, <constant>NULL</constant> |
| 158 |
is returned.</para> |
| 159 |
|
| 160 |
<para>On success, <function>udev_device_get_is_initialized()</function> returns either <constant>1</constant> or |
| 161 |
<constant>0</constant>, depending on whether the passed device has already been initialized by udev or not. On |
| 162 |
failure, a negative error code is returned. Note that devices for which no udev rules are defined are never |
| 163 |
reported initialized.</para> |
| 164 |
</refsect1> |
| 165 |
|
| 166 |
<refsect1> |
| 167 |
<title>History</title> |
| 168 |
<para><function>udev_device_get_syspath()</function>, |
| 169 |
<function>udev_device_get_sysname()</function>, |
| 170 |
<function>udev_device_get_sysnum()</function>, |
| 171 |
<function>udev_device_get_devpath()</function>, |
| 172 |
<function>udev_device_get_devnode()</function>, |
| 173 |
<function>udev_device_get_devnum()</function>, |
| 174 |
<function>udev_device_get_devtype()</function>, |
| 175 |
<function>udev_device_get_subsystem()</function>, |
| 176 |
<function>udev_device_get_driver()</function>, |
| 177 |
<function>udev_device_get_udev()</function>, |
| 178 |
<function>udev_device_get_parent()</function>, |
| 179 |
<function>udev_device_get_parent_with_subsystem_devtype()</function>, |
| 180 |
<function>udev_device_get_is_initialized()</function>, and |
| 181 |
<function>udev_device_get_action()</function> were added in version 221.</para> |
| 182 |
</refsect1> |
| 183 |
|
| 184 |
<refsect1> |
| 185 |
<title>See Also</title> |
| 186 |
|
| 187 |
<para><simplelist type="inline"> |
| 188 |
<member><citerefentry><refentrytitle>udev_new</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 189 |
<member><citerefentry><refentrytitle>udev_device_new_from_syspath</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 190 |
<member><citerefentry><refentrytitle>udev_device_has_tag</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 191 |
<member><citerefentry><refentrytitle>udev_enumerate_new</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 192 |
<member><citerefentry><refentrytitle>udev_monitor_new_from_netlink</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 193 |
<member><citerefentry><refentrytitle>udev_list_entry</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 194 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 195 |
</simplelist></para> |
| 196 |
</refsect1> |
| 197 |
|
| 198 |
</refentry> |