UDEV\_DEVICE\_GET\_SYSPATH(3) udev\_device\_get\_syspath UDEV\_DEVICE\_GET\_SYSPATH(3)

.SH "NAME" 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

.SH "SYNOPSIS"

```
#include <libudev.h>
```

.HP 864u **const char \*udev\_device\_get\_syspath(struct udev\_device \*udev\_device);**

.HP 864u **const char \*udev\_device\_get\_sysname(struct udev\_device \*udev\_device);**

.HP 840u **const char \*udev\_device\_get\_sysnum(struct udev\_device \*udev\_device);**

.HP 864u **const char \*udev\_device\_get\_devpath(struct udev\_device \*udev\_device);**

.HP 864u **const char \*udev\_device\_get\_devnode(struct udev\_device \*udev\_device);**

.HP 696u **dev\_t udev\_device\_get\_devnum(struct udev\_device \*udev\_device);**

.HP 864u **const char \*udev\_device\_get\_devtype(struct udev\_device \*udev\_device);**

.HP 912u **const char \*udev\_device\_get\_subsystem(struct udev\_device \*udev\_device);**

.HP 840u **const char \*udev\_device\_get\_driver(struct udev\_device \*udev\_device);**

.HP 816u **struct udev \*udev\_device\_get\_udev(struct udev\_device \*udev\_device);**

.HP 1032u **struct udev\_device \*udev\_device\_get\_parent(struct udev\_device \*udev\_device);**

.HP 1584u **struct udev\_device \*udev\_device\_get\_parent\_with\_subsystem\_devtype(struct udev\_device \*udev\_device, const char \*subsystem, const char \*devtype);**

.HP 840u **int udev\_device\_get\_is\_initialized(struct udev\_device \*udev\_device);**

.HP 840u **const char \*udev\_device\_get\_action(struct udev\_device \*udev\_device);**

.SH "RETURN VALUE"

.PP On success, **udev\_device\_get\_syspath()**, **udev\_device\_get\_sysname()**, **udev\_device\_get\_sysnum()**, **udev\_device\_get\_devpath()**, **udev\_device\_get\_devnode()**, **udev\_device\_get\_devtype()**, **udev\_device\_get\_subsystem()**, **udev\_device\_get\_driver()** and **udev\_device\_get\_action()** 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 **NULL**.

.PP On success, **udev\_device\_get\_devnum()** returns the device type of the passed device. On failure, a device type with minor and major number set to **0** is returned.

.PP **udev\_device\_get\_udev()** always returns a valid pointer to the udev context that this device belongs to.

.PP On success, **udev\_device\_get\_parent()** and **udev\_device\_get\_parent\_with\_subsystem\_devtype()** 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, **NULL** is returned.

.PP On success, **udev\_device\_get\_is\_initialized()** returns either **1** or **0**, 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.

.SH "HISTORY"

.PP **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()**, and **udev\_device\_get\_action()** were added in version 221.

.SH "SEE ALSO"

.PP [**udev\_new**(3)](/man/os/systemd/udev_new.3), [**udev\_device\_new\_from\_syspath**(3)](/man/os/systemd/udev_device_new_from_syspath.3), [**udev\_device\_has\_tag**(3)](/man/os/systemd/udev_device_has_tag.3), [**udev\_enumerate\_new**(3)](/man/os/systemd/udev_enumerate_new.3), [**udev\_monitor\_new\_from\_netlink**(3)](/man/os/systemd/udev_monitor_new_from_netlink.3), [**udev\_list\_entry**(3)](/man/os/systemd/udev_list_entry.3), [**systemd**(1)](/man/os/systemd/systemd.1)

systemd 262.2

---

Document: udev_device_get_syspath(3) from systemd 262.2-r1 (Chainguard OS)
Source: https://github.com/systemd/systemd
