gpt4 book ai didi

linux-kernel - 进行系统调用以获取进程列表

转载 作者:行者123 更新时间:2023-12-04 16:53:21 24 4
gpt4 key购买 nike

我是模块编程的新手,我需要进行系统调用来检索系统进程并显示它们消耗了多少 CPU。

我怎样才能打这个电话?

最佳答案

为此有一些系统调用,称为 open 和 read。所有进程的信息都保存在/proc/{pid}目录。您可以通过读取相应的文件来收集进程信息。

更多解释:http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/proc.html

关于linux-kernel - 进行系统调用以获取进程列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18408766/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com