我想写一个像系统监视器这样的程序。我想要一个程序列表,上面有它们的进程ID以及CPU和RAM的使用情况。我知道Linux将此信息写入/proc文件夹,但有人告诉我,我也可以使用一些函数来获取它。例如,一个程序将返回如下列表:
name PID RAM
sh 3904 72KIB
我想用C++编写代码。
我有一些linux驱动程序,我想把它从Linux2.4移植到3.0。在这段漫长的时间跨度中,ioctl (unlocked_ioctl now)的参数列表发生了一些变化:
-static int can_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+static long can_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
代码使用inode获取次要版本,并将其传递给其他一些命令。既然inod