如何从Solaris系统获得信息的过程中编程C / C ++?
是否有一个C / C ++库和文档有关如何收集系统和处理信息在Solaris上?
Is there a C/C++ library, and documentation about how to collect system and process information on Solaris?
虽然我可以解析的命令行工具,我宁愿使用一个库,使任务更容易做。
Although I could parse command-line tools, I'd rather use a library that makes the task easier to do.
感谢
编辑:有人建议使用在/ proc虚拟目录收集信息,但其比分析命令行工具,在这个意义上也不遑多让,我需要实现一些排序自定义分析,为每一个数据我需要的。
It has been suggested to use the /proc virtual directory to collect information, however its not much better than parsing command-line tools, in the sense that I'll need to implement some sort of custom parsing for every piece of data I need.
我在寻找一起为Windows或通过提供一个C为基础的系统API这些信息的MacOS C库线的东西,但是我在与谷歌没有运气。
I'm looking for something along the lines of c libraries for Windows or MacOS that provides this information through a c-based systems API, however I'm having no luck with Google.
您可以得到这样的信息与的的kstat API 。
You can get this kind of information with kstat API.
man -s 3KSTAT kstat
您可以看到它是如何在OpenSolaris中的的vmstat 和的 iostat的来源。
You can see how it is used in OpenSolaris vmstat and iostat source.
有关的信息突,我会看的 PS 。
For information about processus, I'd look at ps.