printf("no process has the fifo open for reading\n");       return -1;     }   case -1:     {       printf("something wrong with open the fifo except for ENXIO");       return -1;     }   case 1:     {       printf("open server ok\n");       return 1;     }   default:     {       printf("w_no_r return ----\n");       return 0;     }   }   unlink(FIFO_SERVER); }    int w_open(char*arg) //0  open error for no reading //-1 open error for other reasons //1  open ok {   if(open(arg,O_WRONLY|O_NONBLOCK,0)==-1)   {     if(errno==ENXIO)     {       return 0;     }     else           return -1;   }      return 1; } 
  参考资料 
    - UNIX网络编程第二卷:进程间通信,作者:W.Richard Stevens,译者:杨继张,清华大学出版社。丰富的UNIX进程间通信实例及分析,对Linux环境下的程序开发有极大的启发意义。 
 
    - Linux内核源代码情景分析(上、下),毛德操、胡希明著,浙江大学出版社,当要验证某个结论、想法时,最好的参考资料; 
 
    - UNIX环境高级编程,作者:W.Richard Stevens,译者:尤晋元等,机械工业出版社。具有丰富的编程实例,以及关键函数伴随Unix的发展历程。 
 
    - http://www.linux.org.tw/CLDP/gb/Secure-Programs-HOWTO/x346.html 点明linux下sigaction的实现基础,linux源码../kernel/signal.c更说明了问题; 
 
    - pipe手册,最直接而可靠的参考资料 
 
    - fifo手册,最直接而可靠的参考资料 
 
 
  关于作者 
  郑彦兴,男,现攻读国防科大计算机学院网络方向博士学位。您可以通过电子邮件 mlinux@163.com和他联系。 
  (参考链接: http://www.ibm.com/developerworks/cn/linux/l-ipc/part1/index.html) 
		    
                      
		      
		      
		   |