title: How to find location of C header file errno.h on macOS?
body: <p>I am new to C language and am trying to view the source for the header file <a href="https://pubs.opengroup.org/onlinepubs/009696899/basedefs/errno.h.html" rel="nofollow noreferrer"><code>errno.h</code></a>.</p>
  <p>How can I:</p>
  <ol>
  <li>Figure out where the header file is stored on my computer?</li>
  <li>View the source of the header file?</li>
  </ol>
  <p><strong>What I've Tried</strong></p>
  <p>From <a href="https://stackoverflow.com/a/36103882/11163122">this answer</a>, running <code>gcc --print-file-name=errno.h</code> in my <code>$HOME</code> directory just outputs <code>errno.h</code>.</p>
  <p>From <a href="https://stackoverflow.com/a/503920/11163122">this answer</a>, running <code>cpp -dM /usr/include/errno.h | grep 'define E' | sort -n -k 3</code> outputs:</p>
  <pre class="lang-sh prettyprint-override"><code>clang: error: no such file or directory: '/usr/include/errno.h'
  clang: error: no input files
  </code></pre>
  <p>From <a href="https://stackoverflow.com/a/65866788/11163122">this answer</a>, running <code>clang -E /usr/include/errno.h</code> outputs:</p>
  <pre class="lang-sh prettyprint-override"><code>clang: error: no such file or directory: '/usr/include/errno.h'
  clang: error: no input files
  </code></pre>
  <p>One solution I know works is running <code>sudo find / -name &quot;errno*.h&quot; -type f</code>.  However, this returns <strong>many</strong> results.  I am wondering if there's some programmatic way to find the source using a C-related tool (e.g. by invoking <code>gcc</code>).</p>
  <p><strong>My Computer</strong></p>
  <ul>
  <li>macOS version: 10.15.7 (Catalina)</li>
  <li><code>clang --version</code> --&gt; <code>Apple clang version 12.0.0 (clang-1200.0.32.27)</code></li>
  </ul>