title: Anyone ever have a case where unistd.h cannot be found on Ubuntu?
body: <p>I'm having a wicked time trying to find a bug in my system. It's literally 
  driving me mad.</p>
  
  <p>System: Ubuntu 16.04 LTS, gcc&amp;g++ 4.9, 5.3 5.4 available.</p>
  
  <p>Essentially I was trying to compile some code for point cloud registration, I didn't update my machine, I started see that Boost for some reason had disabled threading, generating multiple errors that no threading libraries could be found. I back tracked everything to a section of the boost header looking at GLib definitions, I checked and it seems my compilers cannot see unistd.h in gcc or g++.
  I checked the files and everything is there, but literally cannot be seen.
  I tried using the -I flag to get the compilers to look in the directory.</p>
  
  <p>Example c code.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;fcntl.h&gt;
  #include &lt;unistd.h&gt;
  int main (int argc, char *argv[])
  {
      int fd1;
      char buf[128];
      fd1 = open(argv[1], O_WRONLY | O_CREAT);
      if (fd1 == -1) {
          perror("File cannot be opened");
          return EXIT_FAILURE;
      }
      scanf("%127s", buf);
      write(fd1, buf, strlen(buf));
      close(fd1);
      return 0;
  }
  </code></pre>
  
  <p>If I try to compile using the command <code>g++ test_unistd.cpp -o main</code>, then I get</p>
  
  <pre><code>/home/user/test_unistd.cpp: In function ‘int main(int, char**)’:
  /home/user/test_unistd.cpp:20:32: error: ‘write’ was not declared in this scope
       write(fd1, buf, strlen(buf));
                                  ^
  /home/user/test_unistd.cpp:22:14: error: ‘close’ was not declared in this scope
       close(fd1);
  </code></pre>
  
  <p>All the files I can see are there, I can't seem to figure out what the problem is.</p>