随笔分类 - Linux C/CPP Programing
摘要:1. interrupt flowHardware->Interrupt Controller->Processor2.Interrupt Handlera. DefinitionThe function that the kernel runs, in response to a specific interrupt.b.Difference between other kernel function.Kernel invoke them.the run in a special context.c.Interrupt handle's jobAcknowledge th
阅读全文
摘要:for code copy in the futuresimple server and clientmay be useful for copy in the futureserver:[cpp] view plaincopy#include<errno.h>#include"sys/types.h"#include"sys/socket.h"#include"sys/stat.h"#include"unistd.h"#include<netinet/in.h>//#include<
阅读全文
摘要:1. definitionlong ptrace(int request, pid_t pid, void * addr, void * data)request , trace type;the request determine the meaning of the other parameters and return value.2.possibility of request[cpp] view plaincopy#definePTRACE_TRACEME0#definePTRACE_PEEKTEXT1#definePTRACE_PEEKDATA2#definePTRACE_PEEK
阅读全文
摘要:socket API原本是为网络通讯设计的,但后来在socket的框架上发展出一种IPC机制,就是UNIX Domain Socket。虽然网络socket也可用于同一台主机的进程间通讯(通过loopback地址127.0.0.1),但是UNIX Domain Socket用于IPC更有效率:不需要经过网络协议栈,不需要打包拆包、计算校验和、维护序号和应答等,只是将应用层数据从一个进程拷贝到另一个进程。 这是因为,IPC机制本质上是可靠的通讯,而网络协议是为不可靠的通讯设计的。UNIX Domain Socket也提供面向流和面向数据包两种API接口,类似于TCP和UDP,但是面向消息的UNI
阅读全文
摘要:exec is used for start another program in the c code of linux1.execl[cpp] view plaincopyintexecl(constchar*path,constchar*arg,...)the last parameter must end up with NULL.[cpp] view plaincopy#include<stdio.h>#include<unistd.h>intmain(){execl("/home/cascais/code/hello","hel
阅读全文

浙公网安备 33010602011771号