title: Using mknod on Ubuntu in c program
body: <p>I am trying to make a c program where i am using mknod command like</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;fcntl.h&gt;
  #include&lt;string.h&gt;
  
  char info[50];
  
  main() {
      int fdr;
      int rc = mknod("testfile",'b',0);
      if(rc&lt;0) {
          perror("Error in mnod");
      }
      fdr=open("testfile",O_RDONLY);
      read(fdr,info,50);
      printf("\n Received message=%s",info);
      printf("\n");
  } 
  </code></pre>
  
  <p>And do some stuff. It works well on Red Hat system, but fails on ubuntu giving error invalid argument. </p>