linux函数、结构体研究
学习别人的,记录自己的。
1、sysinfo用法
#include <sys/sysinfo.h>
int sysinfo(struct sysinfo info);
记录了linux中启动时间、内存信息、交换分区、cpu负载等信息。
成功返回0,失败返回-1
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 */
};
2、statfs用法
#include <sys/vfs.h>
int statfs(const char *path, struct statfs *buf);
int fstatfs(int fd, struct statfs *buf);
struct statfs{
long f_type; 、/*文件系统类型*/
long f_bsize; /*经过优化的传输块大小*/
long f_blocks; /*文件系统数据块总数*/
long f_bfree; /*文件系统空闲块*/
long f_bavail; /*非超级用户可以用的块数*/
long f_files; /*文件节点总数*/
long f_ffree; /*空闲文件节点总数*/
fsid_t f_fsid; /*文件系统标识*/
long f_namelen; /*文件名的最大长度*/
};
相关文档:
一:网络环境
bind9.4
主机名(hostname):centos
ip:192.168.1.168
dns:192.168.1.1(配置完后,需要修改,指向192.168.1.168,修改/etc/resolv.conf),
要达到的目的:把这台主机配置成一台dns服务器
dns server:ns1.test.com
ip:192.168.1.168
www.test.com 192.168.1.168
二:安装过程
安装的目录是/usr/lo ......
1) linux目录架构
/ 根目录
/bin 常用的命令
binary file 的目錄
/boot 存放系统启动时必须读取的档案,包括核心
(kernel) 在内
/boot/grub/menu.lst GRUB设置
/boot/vmlinuz 内核
  ......
Linux安装JDK详细步骤呢将向你介绍Linux安装JDK的每一个细节,这对于程序开发初学者是十分有帮助的。
Linux安装JDK步骤1. 先从网上下载jdk(jdk-1_5_0_02-linux-i586.rpm) ,推荐SUN的官方网站www.sun.com,下载后放在/home目录中,当然其它地方也行。
进入安装目录
#cd /home
#cp jdk-1_5_0_02-linux-i586.rpm /usr/l ......