windows下实现内存文件映射,golang实际是调用的windows api,和win32编程没神马区别。 fsize, err := syscall.Seek(fd, 0, 2)syscall.Seek(fd, 0, 0)//每个block的页面个数var pagesperblock int6 ...
By francis_haoOct 1,2017 本文摘录自bash的man手册 条件表达式 条件表达式是由复合命令 [[ 或内置命令 test 和 [ 使用的,用于测试文件属性和字符串或数值比较。表达式形式如下表所示,如果其中的file形式为/dev/fd/n,那么将测试文件描述符n,如果file... ...
分类:
系统相关 时间:
2017-10-01 23:07:50
阅读次数:
286
1 #include 2 #include 3 #include 4 #include 5 #include 6 7 int main(int argc,char *argv[]){ 8 9 int fd; 10 char name[1024]; 11 int i = 0; 12 while(1){... ...
分类:
系统相关 时间:
2017-09-30 18:04:27
阅读次数:
277
下面是nginx源码程序的configure参数: --prefix= 指向安装目录。默认为:/usr/local/nginx --sbin-path= 指定执行程序文件存放位置。默认为:prefix/sbin/nginx --modules-path= 指定第三方模块的存放路径。 --conf-p ...
分类:
其他好文 时间:
2017-09-29 17:52:13
阅读次数:
150
FD_ZERO,FD_ISSET这些都是套节字结合操作宏 看看MSDN上的select函数, 这是在select io 模型中的核心,用来管理套节字IO的,避免出现无辜锁定. int select( int nfds,fd_set FAR *readfds, fd_set FAR *writefds ...
分类:
其他好文 时间:
2017-09-25 11:40:20
阅读次数:
175
#include #include #include #include //包含open/read/write函数 //命令:./a.out file //读取file中的内容进入buffer,并打印出来 int main(int argc, char *argv[]) { int fd; //文件... ...
分类:
其他好文 时间:
2017-09-24 03:29:44
阅读次数:
213
容器这四点一定要懂:注册服务器、仓库、镜像、容器 他们的范围依次缩小 注册服务器可以有多个仓库,仓库里面可以有多个镜像,每个镜像可以生成多个容器。 docker属于C/S结构 支持三种连接方式: unix:///var/run/docker.sock tcp://host:port fd://soc ...
分类:
其他好文 时间:
2017-09-23 16:18:01
阅读次数:
236
流量统计(统计每个用户的上行流量和下行流量及其流量总和)源数据:13631579850661372623050300-FD-07-A4-72-B8:CMCC120.196.100.82i02.c.aliimg.com24272481246812001363157995052138265441015C-0E-8B-C7-F1-E0:CMCC120.197.40.440264020013631579910761392643565620-10-7A-2..
分类:
其他好文 时间:
2017-09-20 16:22:05
阅读次数:
178
#include "unp.h"static int read_cnt;//刚开始可以置为一个负值(我的理解) static char *read_ptr; static char read_buf[MAXLINE]; static ssize_t my_read(int fd, char *ptr ...
分类:
其他好文 时间:
2017-09-16 17:09:10
阅读次数:
156
#fd { width: 100px; height: 150px; background-color: forestgreen; float: left; } #sd { width: 150px; height: 100px; background-color: coral; float: le... ...
分类:
Web程序 时间:
2017-09-13 01:38:08
阅读次数:
229