Linux下获得CPU利用率和内存使用情况
*/ p = strchr(p, ' \n ' ); p = skip_token(p); memory_stats[ 3 ] = strtoul(p, & p, 10 ); /* cached memory */ for (i = 0 ; i < 8 ;i ++ ) { p ++ ; p = strchr(p, ' \n ' ); } p = skip_token(p); memory_stats[ 4 ] = strtoul(p, & p, 10 ); /* total swap */ p = strchr(p, ' \n ' ); p = skip_token(p); memory_stats[ 5 ] = strtoul(p, & p, 10 ); /* free swap */ } /* set arrays and strings */ info -> cpustates = cpu_states; info -> memory = memory_stats; } 上一篇:开源安全技术逐步迈入中国企业级市场 下一篇:Linux系统Root用户密码丢失怎么办? 更多相关文章
|
推荐文章
精彩文章
|