<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/124652>124652</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [llvm] `'sys/file.h' file not found` when building clang with llvm-libc
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            libc,
            llvm:support
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          nickdesaulniers
      </td>
    </tr>
</table>

<pre>
    seems to be stemming from llvm/lib/Support/Unix/Path.inc

536736995bf5d looks suspicious.  It should only be including `<fcntl.h>` and NOT the non-standard `<sys/file.h>`. fcntl.h should include definitions of `struct flock`, `F_WRLCK`, `F_SETLK`, `F_SETLKW`, `F_UNLCK`. Then llvm-libc can build this file with one less issue.

So the issue lies in llvm (llvm/lib/Support/Unix/Path.inc) but tagging this libc as well to cc the relevant folk.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMk09v4zgMxT-NfCFq2FScPwcfsmkNLLboLrYtelzIFm1ro0iBKbXTbz-Qkk47mMscTYh85Ps9K2YzOaJWNH-I5rZQMcx-aZ0ZjppYResMLVz0Xr-3THRiCB56Ag50Ohk3wbj4E1j7ehLYWdML7B7j-eyXILB7duabwO4fFebSuEFUe1HtG7neyPVu1_Rjo8F6f2TgyGczGB-5BPgzAM8-Wg3e2fckZtxgo05qYl0JeRgHF2w5C3kn1hUop-Hh7ycIM4Hz7oaDclot-vqY31lgNxpLHx0lXAd86FzmE2gajTPBeMfgx9TPYYlDgNH64ZjG4SFVu_9e_r0__PW18Hj3dP9r4eVr5fnh0lPC00wue3ZjTT_AoBz00VgNYTYMaVV4M2EG7wgsMYNhjlRe_Hv0-dJcAmuIwVyGgcDtb4LAHfQxQFDTlFzNsnkVxfBG1ibIw5B1FrL0qlyA0dtjWehW6p3cqYLaeiO3Vb1rcFXMraybnra02azqcRwr6qVUNWnaqlWzVtQXpsUKm6rGDcoaq1VJvd4qreVO1rqqaS1WFZ2UsWW6ofTLVOQT2xpX6wYLq3qynGOKOHmvYTQLh4sPAlHgQSCmIz4_khlyzx82YAr40mbj-zixWFXWcOBPxWCCzb9Cbm1uc4Rw81OEcHMh5HzyJDqdMviWiGaGyc_BKjddEP6gXMTFtnMIZxZyL7AT2E0mzLEvB5-RXcml9-fF_09DApevS-JXF15b_B4AAP__Y8gwKA">