0

trying to create fifo that can read and write. but some reason its not going below "O_RDONLY" line. any thoughts?

char *fifo_name = "fifo";
#define 0666
int main()
{
  int fd1;
  int fd2;  


  //create fifo
  if(mkfifo(fifo_name,FIFO_MODE) == -1)
  {
     exit(1);
  }
  //open fifo for read
  if((fd1 = open(fifo_name, O_RDONLY)) == -1)
  {
       exit(1);
  }
  //------------------------------------------------------------------------------ it doesnt come here
  //open fifo for write 
if((fd2 = open(fifo_name, O_WRONLY)) == -1) 
{ 
    exit(1); 
}
}
1
Contributor
1
Reply
3
Views
5 Years
Discussion Span
Last Post by hwoarang69
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.