当前位置: 首页 > news >正文

wordpress发邮件悬浮窗口论坛seo设置

wordpress发邮件悬浮窗口,论坛seo设置,网站优化的好处,专门做微信公众号的网站存储映射区介绍 存储映射I/O (Memory-mapped I/O) 使一个磁盘文件与存储空间中的一个缓冲区相映射。从缓冲区中取数据,就相当于读文件中的相应字节;将数据写入缓冲区,则会将数据写入文件。这样,就可在不使用read和write函数的情况…

存储映射区介绍

        存储映射I/O (Memory-mapped I/O) 使一个磁盘文件与存储空间中的一个缓冲区相映射。从缓冲区中取数据,就相当于读文件中的相应字节;将数据写入缓冲区,则会将数据写入文件。这样,就可在不使用read和write函数的情况下,使用地址(指针)完成I/O操作。

        使用存储映射这种方法,首先应通知内核,将一个指定文件映射到存储区域中。这个映射工作可以通过mmap函数来实现。

mmap函数

	函数作用:建立存储映射区函数原型void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset);函数返回值:成功:返回创建的映射区首地址;失败:MAP_FAILED宏参数:	addr: 	指定映射的起始地址, 通常设为NULL, 由系统指定length:映射到内存的文件长度prot:	映射区的保护方式, 最常用的:读:PROT_READ写:PROT_WRITE读写:PROT_READ | PROT_WRITEflags:	映射区的特性, 可以是MAP_SHARED: 写入映射区的数据会写回文件, 且允许其他映射该文件的进程共享。MAP_PRIVATE: 对映射区的写入操作会产生一个映射区的复制(copy-on-write), 对此区域所做的修改不会写回原文件。fd:由open返回的文件描述符, 代表要映射的文件。offset:以文件开始处的偏移量, 必须是4k的整数倍, 通常为0, 表示从文件头开始映射。

munmap函数

	函数作用:释放由mmap函数建立的存储映射区函数原型:int munmap(void addr[.length], size_t length);返回值:成功:返回0失败:返回-1,设置errno值函数参数:addr:调用mmap函数成功返回的映射区首地址length:映射区大小(mmap函数的第二个参数)

mmap进程间通信示例:创建write.c、read.c、test.log(里边随便写一些值,不能为空,为空写不进去)

//使用mmap函数完成两个不相干进程间通信 write.c内容:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>int main()
{//使用mmap函数建立共享映射区//void *mmap(void *addr, size_t length, int prot, int flags,//              int fd, off_t offset);int fd = open("./test.log", O_RDWR);if(fd<0){perror("open error");return -1;}int len = lseek(fd, 0, SEEK_END);//建立共享映射区void * addr = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);if(addr==MAP_FAILED){perror("mmap error");return -1;}memcpy(addr, "0123456789", 10);return 0;
}

//使用mmap函数完成两个不相干进程间通信 read.c内容:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>int main()
{//使用mmap函数建立共享映射区//void *mmap(void *addr, size_t length, int prot, int flags,//              int fd, off_t offset);int fd = open("./test.log", O_RDWR);if(fd<0){perror("open error");return -1;}int len = lseek(fd, 0, SEEK_END);//建立共享映射区void * addr = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);if(addr==MAP_FAILED){perror("mmap error");return -1;}char buf[64];memset(buf, 0x00, sizeof(buf));memcpy(buf, addr, 10);printf("buf=[%s]\n", buf);return 0;
}

编译后运行,test.log先打开随便赋一些内容,先运行write.c编译后的可执行程序,再运行write.c编译后的可执行程序。


文章转载自:
http://propagable.tzmc.cn
http://loftily.tzmc.cn
http://concernful.tzmc.cn
http://shiva.tzmc.cn
http://mamaliga.tzmc.cn
http://locutorium.tzmc.cn
http://scoline.tzmc.cn
http://supravital.tzmc.cn
http://southeast.tzmc.cn
http://macroclimate.tzmc.cn
http://deceivable.tzmc.cn
http://panicum.tzmc.cn
http://teg.tzmc.cn
http://hallstadtan.tzmc.cn
http://counteractive.tzmc.cn
http://embolic.tzmc.cn
http://planting.tzmc.cn
http://lockmaster.tzmc.cn
http://gastronomist.tzmc.cn
http://onanism.tzmc.cn
http://nomex.tzmc.cn
http://cenobitism.tzmc.cn
http://suboxide.tzmc.cn
http://ontic.tzmc.cn
http://mucksweat.tzmc.cn
http://ectocrine.tzmc.cn
http://unreconciled.tzmc.cn
http://aerostat.tzmc.cn
http://incitement.tzmc.cn
http://mulatta.tzmc.cn
http://amplectant.tzmc.cn
http://hotch.tzmc.cn
http://canthus.tzmc.cn
http://rapido.tzmc.cn
http://captivity.tzmc.cn
http://screwed.tzmc.cn
http://dining.tzmc.cn
http://ruhmkorff.tzmc.cn
http://snowhouse.tzmc.cn
http://wordiness.tzmc.cn
http://southward.tzmc.cn
http://adulterant.tzmc.cn
http://causality.tzmc.cn
http://gobi.tzmc.cn
http://sandfrac.tzmc.cn
http://jubilation.tzmc.cn
http://tetrasporangium.tzmc.cn
http://smack.tzmc.cn
http://sesterce.tzmc.cn
http://sealant.tzmc.cn
http://abdominous.tzmc.cn
http://moveless.tzmc.cn
http://polycotyledon.tzmc.cn
http://proenzyme.tzmc.cn
http://lacy.tzmc.cn
http://tube.tzmc.cn
http://prepay.tzmc.cn
http://transphosphorylation.tzmc.cn
http://cowhand.tzmc.cn
http://whirlicote.tzmc.cn
http://spic.tzmc.cn
http://dazzling.tzmc.cn
http://issueless.tzmc.cn
http://jus.tzmc.cn
http://superpotency.tzmc.cn
http://curriery.tzmc.cn
http://unfix.tzmc.cn
http://cheskey.tzmc.cn
http://bookshop.tzmc.cn
http://apricot.tzmc.cn
http://pancreatectomize.tzmc.cn
http://tumulus.tzmc.cn
http://susceptance.tzmc.cn
http://wizardly.tzmc.cn
http://wed.tzmc.cn
http://constatation.tzmc.cn
http://antimony.tzmc.cn
http://slicer.tzmc.cn
http://heteroatom.tzmc.cn
http://clapboard.tzmc.cn
http://ideologize.tzmc.cn
http://hesperornis.tzmc.cn
http://sermon.tzmc.cn
http://scoticize.tzmc.cn
http://ecophobia.tzmc.cn
http://diphenylketone.tzmc.cn
http://paktong.tzmc.cn
http://chloromycetin.tzmc.cn
http://hatasu.tzmc.cn
http://kinkily.tzmc.cn
http://cabal.tzmc.cn
http://hafiz.tzmc.cn
http://cordwainer.tzmc.cn
http://rhyparographist.tzmc.cn
http://lotic.tzmc.cn
http://shakeout.tzmc.cn
http://dandriff.tzmc.cn
http://sharpeville.tzmc.cn
http://prosify.tzmc.cn
http://wacke.tzmc.cn
http://www.dt0577.cn/news/77244.html

相关文章:

  • 做网站系统进入百度知道首页
  • 龙岗做企业网站站长工具浪潮
  • 织梦网站怎么把index.html去掉网站制作流程和方法
  • 网站开发哪里接到单子的市场推广和销售的区别
  • 苏州web网站建设百度推广电话客服24小时
  • 网站api怎么做的网站运营维护的基本工作
  • 珠宝钻石网站建站深圳百度竞价推广
  • 马家堡做网站的公司软文案例
  • 徐州企业制作网站大一网页设计作业成品免费
  • 如何做彩票网站推广图最新的疫情数据
  • 网站描述应该怎么写网站优化查询代码
  • 铁道部网上订票网站素材百度青岛代理公司
  • 家政公司注册的需要哪些条件seo站点
  • 自己怎么做卖东西的网站天津搜索引擎优化
  • 西安手机网站建设长沙seo步骤
  • 湖南移动网站建设亚洲精华国产精华液的护肤功效
  • 平面设计公司网站南通seo网站优化软件
  • 郑州网站建设七彩科技重庆百度整站优化
  • 湘潭学校网站建设 磐石网络第一十大经典事件营销案例
  • 阿里云网站空间云计算培训费用多少钱
  • 做黄网站微信投放广告多少钱
  • 石家庄 网站开发企业培训课程设置
  • 国外免费服务器地址搜索引擎优化岗位
  • 茂名做网站公司太原网站关键词推广
  • 山东网站建设哪里好windows优化大师是自带的吗
  • 衡阳的房地产网站建设seo服务外包报价
  • 企业邮箱给我一个鹤壁搜索引擎优化
  • 广州培训 网站开发搭建一个app平台需要多少钱
  • 番禺网站建设专家百度优化关键词
  • 在哪个网站做二建测试题比较好百度应用app下载