简体   繁体   English

-lspci命令的C ++模拟

[英]C++ analogue for -lspci command

I need to search for Hardwares in linux environment based on Vendor IDs programmatically using C++. 我需要使用C ++以编程方式基于供应商ID搜索linux环境中的硬件。 I know that I can get the list using 我知道我可以使用

-lspci -lspci

Can anyone throw some light here?? 有人可以在这里放点灯吗?

Thanks and Best Regards 谢谢和最好的问候

The lspci program uses libpci internally. lspci程序libpci内部使用libpci Both the program and the library are part of the pciutils package. 程序和库都是pciutils软件包的一部分。 To use libpci programmatically from C or C++, I suggest taking a look at the example . 要从C或C ++以编程方式使用libpci ,建议看一下示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM