title: STDIN input size restriction to 1k in C program
body: <p>Probably a silly question, with <em>read</em> and other functions you can specify the number of bytes you want to read, however when reading from stdin I find that I can only type 1024 characters in the prompt, if I type the 1025 character, it's not written and if I want the line to be read (pressing ENTER key) I need to remove the 1024 character in order to leave space for '\n' I suppose. This occurs only in my c program not the shell so what's causing this restriction?</p>
  
  <pre><code>#include &lt;unistd.h&gt;
  #include &lt;stdio.h&gt;
  
  int main() {
      char buf[2048];
      int c;
  
      c = read(fileno(stdin), &amp;buf, sizeof(buf));
      printf("%s\n", buf);
  
      return 0;
  }
  </code></pre>