-lspci 命令的 C++ 模拟

C++ analogue for -lspci command

我需要使用 C++ 以编程方式根据供应商 ID 在 linux 环境中搜索硬件。 我知道我可以使用

获取列表

-lspci

任何人都可以在这里抛砖引玉吗??

谢谢和最诚挚的问候

lspci 程序在内部使用 libpci。程序和库都是 pciutils package. To use libpci programmatically from C or C++, I suggest taking a look at the example.

的一部分