摘要:
#include#include#include#include #include#include #include #include #include //演示父子进程共享文件描述符//相当于2个fd指向同一块内存空间.//因为2个进程共享了文件指针偏移量,所以都能向文件中有序写数据int mai... 阅读全文
posted @ 2015-04-15 15:16
张仕传
阅读(1153)
评论(0)
推荐(0)
摘要:
#include#include#include#include #include#include #include #include #include // 演示 vfork// vfork共享父进程的数据段// vfork函数必须和execle这类函数在一起或者exit// 不建议使用vfork... 阅读全文
posted @ 2015-04-15 15:15
张仕传
阅读(369)
评论(0)
推荐(0)
摘要:
#include#include#include#include #include#include int main(void){ printf("sfsdfsfd"); // 这里没有加\n //exit(0); _exit(0); // 打印不出来 return 0;... 阅读全文
posted @ 2015-04-15 15:14
张仕传
阅读(213)
评论(0)
推荐(0)
摘要:
#include#include#include#include #include#include /*孤儿进程int main(void){ pid_t pid; pid = fork(); if (-1 == pid) { perro... 阅读全文
posted @ 2015-04-15 15:13
张仕传
阅读(161)
评论(0)
推荐(0)
摘要:
#include#include#include#include #includevoid LoopFunc(int);int main(void){ int procNum = 0; int loopNum = 0; int i, j; pid_t pid; ... 阅读全文
posted @ 2015-04-15 15:12
张仕传
阅读(261)
评论(0)
推荐(0)
摘要:
#include#include#include#include #include//fork进程//变量的引申 每一个进程有独立的进程地址空间有更深入的理解//写实复制理解// 1. 子进程修改变量时拷贝// 2. 只拷贝页 ----> Linux内核内存管理机制int main(void){... 阅读全文
posted @ 2015-04-15 15:11
张仕传
阅读(541)
评论(0)
推荐(0)
摘要:
#include#include#include#include #include//fork进程//一次调用,两个分支返回//Linux内核如何做到的这一点?// 每一个进程在各自的地址空间中返回//为什么fork返回值设计成>0是父进程分支 =0是子进程分支// 父子关系是1:n的关系,... 阅读全文
posted @ 2015-04-15 15:09
张仕传
阅读(394)
评论(0)
推荐(0)
摘要:
#include using namespace std;#define StructArrarySize 5 // 老师数量 #define StudentNum 3 // 每位老师... 阅读全文
posted @ 2015-04-15 13:54
张仕传
阅读(174)
评论(0)
推荐(0)
摘要:
/* 题目: //声明一个结构体类型 struct _AdvTeacher { char *name; char *tile; int age; ... 阅读全文
posted @ 2015-04-15 13:53
张仕传
阅读(220)
评论(0)
推荐(0)

浙公网安备 33010602011771号