We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 10 months ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
libudev 是一个非常简单的库。在阅读了您提到的库并使用 API 文档(网站应该很快就会上线)后,我能够得到我想要的东西。 udevadm 很有帮助,在发出
# udevadm info --query=all --name=/path/to/dev
后,您将获得 udev 有关该设备的所有信息,更重要的是,这些是属性函数中使用的参数(例如udev_device_get_property_value(device, "ID_VENDOR")
)。因此,学习 libudev 的最佳方法是在 signal11 教程、API 文档和 udevadm 信息的帮助下开始使用它。编辑:libudev 目前是 systemd 的一部分 - 文档可作为手册页提供 - https ://www.freedesktop.org/software/systemd/man/libudev.html#
libudev is quite simple library. After reading library you've mentioned and using API documentation (site should be soon up) I was able to get what I wanted. udevadm is great help, after issuing
# udevadm info --query=all --name=/path/to/dev
you'll get all information that udev has about this device and what's more important, these are parameters used in property functions (e.g.udev_device_get_property_value(device, "ID_VENDOR")
). So best way to learn libudev is to start using it with help of signal11 tutorial, API documentation and udevadm informations.EDIT: libudev is currently part of systemd - documentation is available as manual pages - https://www.freedesktop.org/software/systemd/man/libudev.html#
对于那些展望 2023 年的人……
正如 Maciej 指出的那样,libudev 现在是 systemd 的一部分。
根据:
https://www.freedesktop.org/software/systemd/人/libudev.html#
sd-device 文档:
https://www.freedesktop.org /software/systemd/man/sd-device.html#
For those looking in 2023...
As Maciej pointed out, libudev is now a part of systemd.
According to:
https://www.freedesktop.org/software/systemd/man/libudev.html#
Documentation for sd-device:
https://www.freedesktop.org/software/systemd/man/sd-device.html#