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。
功能描述:
获取系统总体统计信息。
用法:
#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。
相关文章推荐
- Linux系统调用-- recv/recvfrom/recvmsg函数详解(转)
- PHP调用Linux系统的常用函数
- Linux进程间通讯所使用的系统调用函数
- linux 系统调用与标准库调用的区别详细解析(转)
- linux下系统调用sendfile()函数
- Linux系统调用--getrlimit/setrlimit函数详解
- linux下c编程系统调用之有名管道FIFO函数的使用及案例
- Linux系统调用--fcntl函数详解
- LKM Rootkits on Linux x86 v2.6(含攻击系统调用入口函数)
- linux系统调用和普通函数调用
- Linux系统调用--msgsnd/msgrcv函数详解
- Linux系统调用--ptrace函数详解
- [转]Linux系统调用--semop函数详解
- linux 系统调用与标准库调用的区别详细解析
- Linux系统调用之send/sendto/sendmsg函数解析
- Linux系统调用--getrlimit/setrlimit函数详解
- Linux系统调用--getpid/getppid函数详解
- Linux系统调用fsync函数详解
- linux系统调用system()函数详解
- linux 有关信号的系统调用 signal 等函数