Unix system programming: File open error -


i trying open file created before open command. hangs @ open() command line. have idea?

if(mkfifo("test", s_irwxu | s_irwxg | s_irwxo)) {     printf("file creation error.\n");     return 0; }  // hangs below while (((test_fd = open("test", o_rdonly)) == -1) && (errno == eintr)); 

from manpage of mkfifo :

 opening fifo reading blocks until other process opens   same  fifo  writing,  , vice versa.  see fifo(7) nonblocking handling of fifo special files. 

Comments