2016年12月31日
摘要: #include "stdio.h" #include "unistd.h" #include "sys/types.h" int gvar=2; int main() { pid_t pid; int var = 5; printf("process id:%ld\n",(long)getpid()); printf("gvar=%d var=%d\n",gvar,var); pid=... 阅读全文
posted @ 2016-12-31 14:32 ChaseForFuture 阅读(310) 评论(0) 推荐(0)
摘要: 打印结果: 由此看出 fork()没有共享内存资源,仅仅是复制了父进程的所有资源 阅读全文
posted @ 2016-12-31 14:01 ChaseForFuture 阅读(702) 评论(0) 推荐(0)