摘要:enum { /* * Description of States: * * TCP_SYN_SENT sent a connection request, waiting for ack * * TCP_SYN_RECV received a connection request, sent ac
阅读全文
02 2016 档案
摘要:enum { /* * Description of States: * * TCP_SYN_SENT sent a connection request, waiting for ack * * TCP_SYN_RECV received a connection request, sent ac
阅读全文
摘要:使用多线程时,pthread_create的参数flag有CLONE_FILES, 最终调用do_fork(),并且会根据CLONE_FILES标志来调用copy_files()来共享父进程中的文件描述符(这里包括socketfd)。 使用多进程时,fork的参数flag没有CLONE_FILES,
阅读全文
摘要:第一题: //fork1.c #include <unistd.h> #include <stdio.h> int main(void) { int i = 0; for(i = 0; i < 3; i++) { pid_t fpid = fork(); if(fpid == 0) { printf
阅读全文
|