设为首页 加入收藏

TOP

Linux系统调用之sysinfo函数解析
2014-11-23 22:39:20 来源: 作者: 【 】 浏览:7
Tags:Linux 系统 调用 sysinfo 函数 解析

【sysinfo系统调用】

功能描述:
获取系统总体统计信息。

用法:
#include


int sysinfo(struct sysinfo *info);



参数:
info:指向sysinfo结构的指针,原型如下,Linux版本必须>=2.3.23(i386),或者>=2.3.48(其它平台)。


struct sysinfo {
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* swap space still available */
unsigned short procs; /* Number of current processes */
unsigned long totalhigh; /* Total high memory size */
unsigned long freehigh; /* Available high memory size */
unsigned int mem_unit; /* Memory unit size in bytes */
char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding for libc5 */
};



返回说明:
成功执行时,返回0。失败返回-1,errno被设为EFAULT。


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Linux shell 截取字符方法 下一篇SQLite for linux 的安装过程

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: