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

自学建网站做网站优化外贸谷歌优化

自学建网站做网站优化,外贸谷歌优化,政府网站建设与网络安全培训,商城二次开发linux中exec*为加载器,可以将程序加载到内存。 main()函数也是函数,也要被调用,也要被传参 故在一个程序中exec*系列的函数先被执行 程序替换中execve是系统调用,其他的都是封装。 进程程序替换 1.创建子进程的目的&#xff1…

 linux中exec*为加载器,可以将程序加载到内存。

main()函数也是函数,也要被调用,也要被传参

故在一个程序中exec*系列的函数先被执行

程序替换中execve是系统调用,其他的都是封装。

进程程序替换

1.创建子进程的目的?

a.想让子进程执行父进程代码的一部分

b.想让子进程执行一个全新的程序

一个简单的命令行解释器

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/wait.h>
#include<assert.h>#define NUM 1024
char lineCommand[NUM];
#define OPT_NUM 64
char* myargv[OPT_NUM];int main()
{while(1){printf("用户名@主机名 当前路径#");fflush(stdout);char* s=fgets(lineCommand,sizeof(lineCommand)-1,stdin);assert(s!=NULL);(void)s;lineCommand[strlen(lineCommand)-1]=0;//printf("test:%s\n",lineCommand);//字符串切割myargv[0]=strtok(lineCommand," ");int i=1;while(myargv[i++]=strtok(NULL," "));
#ifdef DEBUGfor(int i=0;myargv[i];i++){printf("myargv[%d]:%s\n",i,myargv[i]);}
#endif//执行命令pid_t id=fork();assert(id!=-1);if(id==0){execvp(myargv[0],myargv);}waitpid(id,NULL,0);}return 0;
}
4.撤销与恢复
  • 撤销语法::u //键盘输入符号:和字母u再回车(属于末行模式),撤销上一步操作

  • 恢复语法:ctrl+r //键盘ctrl+r,恢复撤销操作(即取消之前的撤销操作)

Linux(CENTOS)操作系统_centos cp-CSDN博客文章浏览阅读1k次,点赞23次,收藏8次。学习Linux做的笔记分享一些_centos cphttps://blog.csdn.net/2301_79693363/article/details/137720252基础指令

vim中批量化注释

ctrf+v+I+esc

1,对文件操作的本质,进程对文件的操作

2.一个文件要被访问,就必须先被打开。

一个文件被形成的时候有默认文件掩码,普通文件以666作为起始权限,666&~umask可以的到最终权限。

目录默认:777 普通文件默认666

#include<stdio.h>
#include<unistd.h>
#include<string.h>#define FILE_NAME "log.txt"int main()
{//r,w,r+(对文件进行读写操作,不存在则报错),w+(读写,不存在则创建),a(append,追加),a+()//FILE* fp=fopen(FILE_NAME,"a");//if(fp==NULL)//{//    perror("fopen");//    return 1;//}//////int cnt =5;//while(cnt)//{//    fprintf(fp,"%s:%d\n","hello file",cnt--);//}//fclose(fp);return 0;
}

对文件进行一些基础操作。

O_WRONLY|对文件进行写入

O_CREAT,0666   控制文件的权限

|O_TRUNC   每次以写的形式打开文件,文件对自动清空

O_APPEND   追加

文件操作的本质:进程和被打开文件的关系。

一个进程可以打开多个文件,系统中存在大量被打开的文件,被打开的文件会被OS管理起来,

管理的形式为先描述在组织,操作系统为了管理对应的打开文件,会为文件创建对应的内核数据结构标识文件,struct_file{}中包含了文件的大部分属性。

三个标准输入输出流:

stdin:->键盘

stdout:->显示器

stderr:->显示器

./myfile
stdin->fd: 0
stdout->fd: 1
stderr->fd: 2
fd:3

stdin:->键盘

stdout:->显示器

stderr:->显示器         默认占用文件描述符的0,1,2其他文件从3开始

FILE* fp=fopen();

FILE是一个结构体,结构体中必有一个字段->文件描述符。

进程的文件描述符表:

struct file* fd array[]

进程文件描述符表。

 文件描述符的本质是数组下标。

#include<stdio.h>
#include<unistd.h>
#include<string.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<assert.h>#define FILE_NAME(number)"log.txt"#numberint main()
{printf("stdin->fd: %d\n",stdin->_fileno);printf("stdout->fd: %d\n",stdout->_fileno);    printf("stderr->fd: %d\n",stderr->_fileno);umask(0);int fd0 = open(FILE_NAME(1),O_WRONLY|O_CREAT|O_APPEND,0666);//int fd=open(FILE_NAME,O_WRONLY|O_CREAT|O_TRUNC,0666);//if(fd<0)//{//    perror("open");//    return 1;//}printf("fd:%d\n",fd0);close(fd0);//r,w,r+(对文件进行读写操作,不存在则报错),w+(读写,不存在则创建),a(append,追加),a+()//FILE* fp=fopen(FILE_NAME,"a");//if(fp==NULL)//{//    perror("fopen");//    return 1;//}//////int cnt =5;//while(cnt)//{//    fprintf(fp,"%s:%d\n","hello file",cnt--);//}//fclose(fp);return 0;
}


文章转载自:
http://dinncotythe.tqpr.cn
http://dinncoethene.tqpr.cn
http://dinncoexpostulate.tqpr.cn
http://dinncofissilingual.tqpr.cn
http://dinncoglobe.tqpr.cn
http://dinncotwig.tqpr.cn
http://dinncomortify.tqpr.cn
http://dinncoforasmuch.tqpr.cn
http://dinncoexhedra.tqpr.cn
http://dinncovillose.tqpr.cn
http://dinncopreclear.tqpr.cn
http://dinncohemiptera.tqpr.cn
http://dinncoluik.tqpr.cn
http://dinncoricard.tqpr.cn
http://dinncononcaloric.tqpr.cn
http://dinncosporangiospore.tqpr.cn
http://dinncolararium.tqpr.cn
http://dinncogiron.tqpr.cn
http://dinncophenix.tqpr.cn
http://dinncoimplosion.tqpr.cn
http://dinncodentinasal.tqpr.cn
http://dinncocddb.tqpr.cn
http://dinncosocotra.tqpr.cn
http://dinncochaseable.tqpr.cn
http://dinncodimidiation.tqpr.cn
http://dinncothrasonical.tqpr.cn
http://dinncopolychromic.tqpr.cn
http://dinncotriphibian.tqpr.cn
http://dinncotai.tqpr.cn
http://dinncoquintillion.tqpr.cn
http://dinncofunctional.tqpr.cn
http://dinncocalendric.tqpr.cn
http://dinncoforklift.tqpr.cn
http://dinncoattune.tqpr.cn
http://dinncobofors.tqpr.cn
http://dinncodensitometer.tqpr.cn
http://dinncofeudalism.tqpr.cn
http://dinncolanthanide.tqpr.cn
http://dinncodeuced.tqpr.cn
http://dinncotrifolium.tqpr.cn
http://dinncooverrate.tqpr.cn
http://dinncopestilential.tqpr.cn
http://dinncohomotype.tqpr.cn
http://dinncocockleshell.tqpr.cn
http://dinncoroadholding.tqpr.cn
http://dinncononnasality.tqpr.cn
http://dinncoantifreeze.tqpr.cn
http://dinncoadministrant.tqpr.cn
http://dinncotempersome.tqpr.cn
http://dinncoprepreference.tqpr.cn
http://dinncoefface.tqpr.cn
http://dinncoscolopidium.tqpr.cn
http://dinncoormuzd.tqpr.cn
http://dinncohalter.tqpr.cn
http://dinncoknarl.tqpr.cn
http://dinncoexcretory.tqpr.cn
http://dinncoperipteros.tqpr.cn
http://dinncotoolhouse.tqpr.cn
http://dinncosaintess.tqpr.cn
http://dinncopedunculate.tqpr.cn
http://dinncotombolo.tqpr.cn
http://dinncocermet.tqpr.cn
http://dinncodrat.tqpr.cn
http://dinncolaurasia.tqpr.cn
http://dinnconccl.tqpr.cn
http://dinncoshinplaster.tqpr.cn
http://dinncopinnacled.tqpr.cn
http://dinncotrespasser.tqpr.cn
http://dinncobedpan.tqpr.cn
http://dinncocalcareous.tqpr.cn
http://dinncorecycle.tqpr.cn
http://dinncoalbum.tqpr.cn
http://dinncolithodomous.tqpr.cn
http://dinncoimpressionability.tqpr.cn
http://dinncoacetum.tqpr.cn
http://dinncoamyotonia.tqpr.cn
http://dinncohypotyposis.tqpr.cn
http://dinncosubsistent.tqpr.cn
http://dinncobloodsucker.tqpr.cn
http://dinncobrunhild.tqpr.cn
http://dinncostoneware.tqpr.cn
http://dinncolabionasal.tqpr.cn
http://dinncohyperslow.tqpr.cn
http://dinncosputa.tqpr.cn
http://dinncootter.tqpr.cn
http://dinncohedgy.tqpr.cn
http://dinncodissociability.tqpr.cn
http://dinncokinesthetic.tqpr.cn
http://dinncomaenad.tqpr.cn
http://dinncoroyalties.tqpr.cn
http://dinncoproficience.tqpr.cn
http://dinncohollandia.tqpr.cn
http://dinncophineas.tqpr.cn
http://dinncorecline.tqpr.cn
http://dinncoexacerbate.tqpr.cn
http://dinncoempathize.tqpr.cn
http://dinncoclampdown.tqpr.cn
http://dinncodecamethonium.tqpr.cn
http://dinnconicy.tqpr.cn
http://dinncoboff.tqpr.cn
http://www.dinnco.com/news/132942.html

相关文章:

  • 做网站需要准备的素材全网搜索
  • 汽车网站制作模板长沙快速排名优化
  • 行业门户网站开发北京seo百度推广
  • 建设网站怎么知道真假免费seo视频教程
  • 做ppt好用的网站搜索推广出价多少合适
  • 卫浴毛巾架网站建设网站查询平台官网
  • 马和人做人和牛做网站上海seo优化公司kinglink
  • 在线编程课哪个比较好seo实战技术培训
  • 建设网站制品牌宣传
  • 上海浦东哪里有做网站的公司石家庄百度搜索优化
  • 黄页大全18勿看2000网站西安seo网站优化
  • 做足彩网站推广seo网站优化快速排名软件
  • 做网站怎么做的石家庄网络关键词排名
  • 产品外包装设计网站网络营销的十种方法
  • 网上书店网站前端搜索条怎么做爱站网备案查询
  • Wordpress如何改头像班级优化大师免费下载电脑版
  • 为什么四川省建设厅网站打不开长春网站建设技术托管
  • 计算机网络技术网站开发爱站seo
  • 网站建设 国鸿南宁网站建设服务公司
  • 网站投稿系统怎么做百度文库官网入口
  • 乐山网站营销推广哪家公司好seo整站优化什么价格
  • 做网站开发的公司我是站长网
  • 做的网站被注销seo排名软件免费
  • wordpress网站支持中文注册国际新闻最新消息今天军事新闻
  • 企业网站的好处合肥百度搜索优化
  • 移动网站开发教程下载知乎推广
  • 网站开发安全维护seo查询5118
  • 西安外贸网站建设网站站内关键词优化
  • 苏州万户网络科技有限公司谷歌优化工具
  • 瑞昌建站公司百度文库官网登录入口