您的位置:首页 > 运维架构 > Linux

Linux系统调用之sysinfo函数解析

2008-11-30 22:22 711 查看
【sysinfo系统调用】

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

用法:
#include <sys/sysinfo.h>

int sysinfo(struct sysinfo *info);

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

window.google_render_ad();

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。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: