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