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

    <tr>
        <th>Summary</th>
        <td>
            Do not set `errno` in libc internal code
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Some parts of libc internal code in `src/__support` and elsewhere set `errno` on error. Internal code should not set `errno` but rather return the error values. Setting `errno` should be done only in the implementations of the public libc functions. This will also make the solution to address #59276 simpler.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtUk2P3CAM_TXJxWqUQD4mBw6tVpV63t5XEDwTtgQibGa0_74k26pabSUknr-enw0m2jf1HDeEXScmiFfwzizgAmMK2sMSLRYLqrGltFTi-8sL5X2PiYsHdLCAnvCxYkIg5CMPUwrxiMYABcfUwI8PdLTG7C2EyJ9KTGZImgsdJOScAhT8zgJ37TNSA8_I7MLtQ90fSoNgY8DS2b8dqo9it-0eNwys2cVwjni492y8W96nveawnMEGfq6O4OG8B-0pwqZ_4ZlO0ecjBTiCtjYhEVRCDrOYRqCzR2pqVN04zpfpImVXWyXtLGdds2OP6in-d-Ki8vPG65y8Wpl3quTXsvRybo7XbJolbsXw_v73-rKn-IoLF9MRlQUVcKi61KtCFF0vJinlNKKZrmjb4sBB23603dTXXpvyfKoavlVCBHzASVFwNTzVTolWiE60XTu1g2wbc7VC637uWm1xXIaqb3HTzjeHjiamW53UKcnkG5Wgd8T0L6iJ3C0gnu0Kv868xqTI3fWylp-UdH22V6f838jE314">