发布时间:2014-09-21 13:04:00
exec用被执行的程序完全替换调用它的程序的影像。fork创建一个新的进程就产生了一个新的PID, exec启动一个新程序,替换原有的进程,因此这个新的被exec执行的进程的PID不会改变, 和调用exec函数的进程一样。 int exec…装入和运行其它程序: int execl( char *pathname,char *arg0,char *arg1,...,char *argn,NULL) int execle( char *pathname,char *ar......【阅读全文】
发布时间:2014-09-21 13:03:57
http://ishare.iask.sina.com.cn/download/explain.php?fileid=10466019&page=0......【阅读全文】
发布时间:2014-09-21 13:03:49
覆盖型写法 (文件里原来的内容被覆盖)echo "aaa" > a.txtecho aaa > a.txt添加型写法 (新内容添加在原来内容的后面)echo "aaa" >> a.txtecho aaa >> a.txt其中 echo <string> >or>> file,在 user space 中会赋值到 buf 中为 string+换行符,传入到 kernel space 时,buf 为 string+换行符,strlen(buf) = strlen(string) + 1; MicrosoftInterne......【阅读全文】
发布时间:2014-09-21 13:03:46
使用的 glibc : glibc-2.17使用的 linux kernel :linux-3.2.07 系统调用是内核向用户进程提供服务的唯一方法,应用程序调用操作系统提供的功能模块(函数)。用户程序通过系统调用从用户态(user mode)切换到核心态(kernel mode ),从而可以访问相应的资源。这样做的好处是:为用户空间提供了一种硬件的抽象接口,使编程更加容易。有利于系统安全。有利于每个进程度运行在虚拟系统中,接口统一有利于移植。 ......【阅读全文】
发布时间:2014-09-21 13:03:41
test.c 点击(此处)折叠或打开#include <stdio.h>#include <fcntl.h>#include <unistd.h>#include <malloc.h>int main(void){ int handle,bytes; void *ptr; ......【阅读全文】