title: Gcc and g++ different on write()
body: <pre><code>#include &lt;sys/syscall.h&gt;
  #define BUFSIZE 1024
  
  main()
  {
       char buf[BUFSIZE];
       int n;
       while((n=read(0,buf,BUFSIZE))&gt;0)
           write(1,buf,n);
       return 0;
  }
  </code></pre>
  
  <p>When I compile this by using gcc, it is fine.
  But use g++ I got :</p>
  
  <pre><code>inandout.c:7:32: error: ‘read’ was not declared in this scope
       while((n=read(0,buf,BUFSIZE))&gt;0)
                                  ^
  inandout.c:8:22: error: ‘write’ was not declared in this scope
           write(1,buf,n);
                        ^
  </code></pre>
  
  <p>Why is that?</p>