Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的程序中,我使用 fork 和 execv 生成子进程。我将子 PID 保存在一个数组中。如何使用这些 PID 获取有关孩子的信息?我想获取诸如他们使用了多少内存和 CPU 之类的信息。
您可以尝试使用库libgtop 或直接解析
/proc/PID/stat