03 2013 档案

socket
摘要:在做一个简单的socket程序时,遇到当client退出时,server状态为defunct情况。过程如下:(1) Server <-- Client(2) Server (accept) <-X- Client (fork) | New Server <-----+(3) Server 杀掉Client后 New Server <defunct>原因:在子进程退出时,发送了SIGCHLD信号。解决方法在父进程中waitpid(); 可以获得子进程的退出状态void sig_chld (int signo) { pid_t pid; int stat; while 阅读全文

posted @ 2013-03-27 14:54 cfox 阅读(618) 评论(0) 推荐(0)

C语言模块化
摘要:模块化中回调函数实现 阅读全文

posted @ 2013-03-27 13:45 cfox 阅读(214) 评论(0) 推荐(0)

C语言不透明结构体实现
摘要:不透明结构体实现 阅读全文

posted @ 2013-03-27 13:09 cfox 阅读(439) 评论(0) 推荐(0)

linux工具
摘要:linux一些工具 阅读全文

posted @ 2013-03-21 10:54 cfox 阅读(181) 评论(0) 推荐(0)

导航