| 1 |
'\" t |
| 2 |
.TH "UDEV_DEVICE_GET_SYSPATH" "3" "" "systemd 259.5" "udev_device_get_syspath" |
| 3 |
.\" ----------------------------------------------------------------- |
| 4 |
.\" * Define some portability stuff |
| 5 |
.\" ----------------------------------------------------------------- |
| 6 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 7 |
.\" http://bugs.debian.org/507673 |
| 8 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
| 9 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 10 |
.ie \n(.g .ds Aq \(aq |
| 11 |
.el .ds Aq ' |
| 12 |
.\" ----------------------------------------------------------------- |
| 13 |
.\" * set default formatting |
| 14 |
.\" ----------------------------------------------------------------- |
| 15 |
.\" disable hyphenation |
| 16 |
.nh |
| 17 |
.\" disable justification (adjust text to left margin only) |
| 18 |
.ad l |
| 19 |
.\" ----------------------------------------------------------------- |
| 20 |
.\" * MAIN CONTENT STARTS HERE * |
| 21 |
.\" ----------------------------------------------------------------- |
| 22 |
.SH "NAME" |
| 23 |
udev_device_get_syspath, udev_device_get_sysname, udev_device_get_sysnum, udev_device_get_devpath, udev_device_get_devnode, udev_device_get_devnum, udev_device_get_devtype, udev_device_get_subsystem, udev_device_get_driver, udev_device_get_udev, udev_device_get_parent, udev_device_get_parent_with_subsystem_devtype, udev_device_get_is_initialized, udev_device_get_action \- Query device properties |
| 24 |
.SH "SYNOPSIS" |
| 25 |
.sp |
| 26 |
.ft B |
| 27 |
.nf |
| 28 |
#include <libudev\&.h> |
| 29 |
.fi |
| 30 |
.ft |
| 31 |
.HP \w'const\ char\ *udev_device_get_syspath('u |
| 32 |
.BI "const char *udev_device_get_syspath(struct\ udev_device\ *" "udev_device" ");" |
| 33 |
.HP \w'const\ char\ *udev_device_get_sysname('u |
| 34 |
.BI "const char *udev_device_get_sysname(struct\ udev_device\ *" "udev_device" ");" |
| 35 |
.HP \w'const\ char\ *udev_device_get_sysnum('u |
| 36 |
.BI "const char *udev_device_get_sysnum(struct\ udev_device\ *" "udev_device" ");" |
| 37 |
.HP \w'const\ char\ *udev_device_get_devpath('u |
| 38 |
.BI "const char *udev_device_get_devpath(struct\ udev_device\ *" "udev_device" ");" |
| 39 |
.HP \w'const\ char\ *udev_device_get_devnode('u |
| 40 |
.BI "const char *udev_device_get_devnode(struct\ udev_device\ *" "udev_device" ");" |
| 41 |
.HP \w'dev_t\ udev_device_get_devnum('u |
| 42 |
.BI "dev_t udev_device_get_devnum(struct\ udev_device\ *" "udev_device" ");" |
| 43 |
.HP \w'const\ char\ *udev_device_get_devtype('u |
| 44 |
.BI "const char *udev_device_get_devtype(struct\ udev_device\ *" "udev_device" ");" |
| 45 |
.HP \w'const\ char\ *udev_device_get_subsystem('u |
| 46 |
.BI "const char *udev_device_get_subsystem(struct\ udev_device\ *" "udev_device" ");" |
| 47 |
.HP \w'const\ char\ *udev_device_get_driver('u |
| 48 |
.BI "const char *udev_device_get_driver(struct\ udev_device\ *" "udev_device" ");" |
| 49 |
.HP \w'struct\ udev\ *udev_device_get_udev('u |
| 50 |
.BI "struct udev *udev_device_get_udev(struct\ udev_device\ *" "udev_device" ");" |
| 51 |
.HP \w'struct\ udev_device\ *udev_device_get_parent('u |
| 52 |
.BI "struct udev_device *udev_device_get_parent(struct\ udev_device\ *" "udev_device" ");" |
| 53 |
.HP \w'struct\ udev_device\ *udev_device_get_parent_with_subsystem_devtype('u |
| 54 |
.BI "struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct\ udev_device\ *" "udev_device" ", const\ char\ *" "subsystem" ", const\ char\ *" "devtype" ");" |
| 55 |
.HP \w'int\ udev_device_get_is_initialized('u |
| 56 |
.BI "int udev_device_get_is_initialized(struct\ udev_device\ *" "udev_device" ");" |
| 57 |
.HP \w'const\ char\ *udev_device_get_action('u |
| 58 |
.BI "const char *udev_device_get_action(struct\ udev_device\ *" "udev_device" ");" |
| 59 |
.SH "RETURN VALUE" |
| 60 |
.PP |
| 61 |
On success, |
| 62 |
\fBudev_device_get_syspath()\fR, |
| 63 |
\fBudev_device_get_sysname()\fR, |
| 64 |
\fBudev_device_get_sysnum()\fR, |
| 65 |
\fBudev_device_get_devpath()\fR, |
| 66 |
\fBudev_device_get_devnode()\fR, |
| 67 |
\fBudev_device_get_devtype()\fR, |
| 68 |
\fBudev_device_get_subsystem()\fR, |
| 69 |
\fBudev_device_get_driver()\fR |
| 70 |
and |
| 71 |
\fBudev_device_get_action()\fR |
| 72 |
return a pointer to a constant string that describes the requested property\&. The lifetime of this string is bound to the device it was requested on\&. On failure, each function may return |
| 73 |
\fBNULL\fR\&. |
| 74 |
.PP |
| 75 |
On success, |
| 76 |
\fBudev_device_get_devnum()\fR |
| 77 |
returns the device type of the passed device\&. On failure, a device type with minor and major number set to |
| 78 |
\fB0\fR |
| 79 |
is returned\&. |
| 80 |
.PP |
| 81 |
\fBudev_device_get_udev()\fR |
| 82 |
always returns a valid pointer to the udev context that this device belongs to\&. |
| 83 |
.PP |
| 84 |
On success, |
| 85 |
\fBudev_device_get_parent()\fR |
| 86 |
and |
| 87 |
\fBudev_device_get_parent_with_subsystem_devtype()\fR |
| 88 |
return a pointer to the parent device\&. No additional reference to this device is acquired, but the child device owns a reference to such a parent device\&. On failure, |
| 89 |
\fBNULL\fR |
| 90 |
is returned\&. |
| 91 |
.PP |
| 92 |
On success, |
| 93 |
\fBudev_device_get_is_initialized()\fR |
| 94 |
returns either |
| 95 |
\fB1\fR |
| 96 |
or |
| 97 |
\fB0\fR, depending on whether the passed device has already been initialized by udev or not\&. On failure, a negative error code is returned\&. Note that devices for which no udev rules are defined are never reported initialized\&. |
| 98 |
.SH "HISTORY" |
| 99 |
.PP |
| 100 |
\fBudev_device_get_syspath()\fR, |
| 101 |
\fBudev_device_get_sysname()\fR, |
| 102 |
\fBudev_device_get_sysnum()\fR, |
| 103 |
\fBudev_device_get_devpath()\fR, |
| 104 |
\fBudev_device_get_devnode()\fR, |
| 105 |
\fBudev_device_get_devnum()\fR, |
| 106 |
\fBudev_device_get_devtype()\fR, |
| 107 |
\fBudev_device_get_subsystem()\fR, |
| 108 |
\fBudev_device_get_driver()\fR, |
| 109 |
\fBudev_device_get_udev()\fR, |
| 110 |
\fBudev_device_get_parent()\fR, |
| 111 |
\fBudev_device_get_parent_with_subsystem_devtype()\fR, |
| 112 |
\fBudev_device_get_is_initialized()\fR, and |
| 113 |
\fBudev_device_get_action()\fR |
| 114 |
were added in version 221\&. |
| 115 |
.SH "SEE ALSO" |
| 116 |
.PP |
| 117 |
\fBudev_new\fR(3), \fBudev_device_new_from_syspath\fR(3), \fBudev_device_has_tag\fR(3), \fBudev_enumerate_new\fR(3), \fBudev_monitor_new_from_netlink\fR(3), \fBudev_list_entry\fR(3), \fBsystemd\fR(1) |