linux上c语言 获得网络接口的统计值
这个东东,蛮好玩的。其实就是读取了/proc/net/dev 文件。
struct netdev_stats {
unsigned long long rx_packets_m; /* total packets received */
unsigned long long tx_packets_m; /* total packets transmitted */
unsigned long long rx_bytes_m; /* total bytes received */
unsigned long long tx_bytes_m; /* total bytes transmitted */
unsigned long rx_errors_m; /* bad packets received */
unsigned long tx_errors_m; /* packet transmit problems */
unsigned long rx_dropped_m; /* no space in linux buffers */
unsigned long tx_dropped_m; /* no space available in linux */
unsigned long rx_multicast_m; /* multicast packets received */
unsigned long rx_compressed_m;
unsigned long tx_compressed_m;
unsigned long collisions_m;
/* detailed rx_errors: */
unsigned long rx_length_errors_m;
unsigned long rx_over_errors_m; /* receiver ring buff overflow */
unsigned long rx_crc_errors_m; /* recved pkt with crc error */
unsigned long rx_frame_errors_m; /* recv'd frame alignment error */
unsigned long rx_fifo_errors_m; /* recv'r fifo overrun */
unsigned long rx_missed_errors_m;&nb
相关文档:
Linux下的进程通信手段基本上是从Unix平台上的进程通信手段继承而来的。而对Unix发展做出重大贡献的两大主力AT&T的贝尔实验室及BSD(加州大学伯克利分校的伯克利软件发布中心)在进程间通信方面的侧重点有所不同。前者对Unix早期的进程间通信手段进行了系统的改进和扩充,形成了“ ......
进程在操作系统中都有一个户口,用于表示这个进程。这个户口操作系统被称为PCB(进程控制块),在linux中具体实现是
task_struct数据结构,它记录了一下几个类型的信息:
1.状态信息,例如这个进程处于可执行状态,休眠,挂起等。
2.性质,由于unix有很多变种,进程有自己独特的性质。
3.资源,资源的链接比如内存, ......
linux 常用命令总结:
一。 通用命令:
1. date :print or set the system date and time
2. stty -a: 可以查看或者打印控制字符(Ctrl-C, Ctrl-D, Ctrl-Z等)
3. passwd: print or set the system date and time (用passwd -h查看)
4. logout, login: 登录shell的登录和注销命令
5. pwd: print or set the system ......
2009年12月28日是Linux创始人Linus的40岁生日。
19年前,在圣诞节后赫尔辛基商店开业的第一天,Linus冲向电脑商店,用圣诞节和生日礼金购买了他的第一台PC:一台DX33 80386计算机,4 Megs RAM,40 Megabyte硬盘,没有协同处理器。Linus之所以选择80386,而 ......
1.时间表示
在程序当中,我们经常要输出系统当前的时间,比如我们使用date命令的输出结果。这个时候我们可以使用下面两个函数
time_t time(time_t *tloc); //时间精度为秒
char *ctime(const time_ ......