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

    <tr>
        <th>Summary</th>
        <td>
            [libc] riscv32 sysconf cannot get page size properly
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc
      </td>
    </tr>

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

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

<pre>
    ```
[1474/1621] Running unit test libc.test.src.unistd.sysconf_test
FAILED: libc/test/src/unistd/CMakeFiles/libc.test.src.unistd.sysconf_test /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc/test/src/unistd/CMakeFiles/libc.test.src.unistd.sysconf_test 
cd /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc/test/src/unistd && /home/libcrv32buildbot/cross.sh /home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/build/libc/test/src/unistd/libc.test.src.unistd.sysconf_test.__build__
sh: line 1: /timer.24741: Permission denied
[==========] Running 1 test from 1 test suite.
[ RUN      ] LlvmLibcSysconfTest.PagesizeTest
/home/libcrv32buildbot/bbroot/libc-riscv32-qemu-yocto-fullbuild-dbg/llvm-project/libc/test/src/unistd/sysconf_test.cpp:16: FAILURE
          Expected: pagesize
          Which is: -1
To be greater than: 0l
          Which is: 0
[  FAILED  ] LlvmLibcSysconfTest.PagesizeTest
```

This is also reproduced with toybox (https://landley.net/toybox/) after mounting the binary and interpreter.

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzEVU2P5DQQ_TXOpdSR43x1H3LI0hMJaUCr2V4hcWnZTiUxOHawnWabX4-cNLAjxA6HFVg-VFwffnn1UuHeq9EgNqR8R8pzwtcwWdd8kJOzvTIjuh-nNRG2vzekoo9NW1K-y4q6IKzLKpaR8gwvqzHKjLAaFSCgD6CVkGm0Uu9kuhrlQ5_6u5fWDNd4Tmjbtd8-P51J3m7RhHXbOeu8iw97DmHdN9_xn7FTGj1h3Zt1gbBusjM-Yt0tZ2JVuhc2lhbC2c2IvoNTXt5ydvgF5_VwtzLYw7BqvcUfejHGhGg_4r8aQtrK_j_HCYRVhFVfvlc6633qp_-DxTeJS6_XrdD1Smjrp104BiGLViyrZnQpK-piO3mPblbeK2ugR6Ow36VL8vOX9mdqznYpD87Of9h-VQHTvRC8fPwethWTnvVtflZCftgBXyLe93xEr37Dy673r8up1rf5sDj7E8rwFrWvWJTLQvI2qyJH8RP8-PJEaAt_rqdPC8qAffQvjzd4FfDDpOQEyseAQ0Zoe7EgEEaHPKCDMHETXVT_Y9ZjigDsI-DfM_j5FKLtZVIelAeuvQWHi7P9KrGHX1WYINi7sJ-AsOMUwhKvJayLRHHTa7ynBiNRe9TmOQEfIv7ZribE_ocJQSjD3R246UGZgG5xGNBFBSR9k_en_MQTbLK6opTlx5omU1NwzvFY11TUos9qeeqHCo_I67IUjDFMVMMoKzNKT1mZZ_SYDpkoTkWdFwOV5cAHUlCcudJp7HFq3Zgo71dssopVdZZoLlD7bWgztvedxfHtmk0TYh09KahWPvi_KgQV9Dbot4TyDA-JwUMbILkxNsCIYes6RNphcXZBp-_J6nTzmsdRhWkVqbTzQ4x_1-SG2u__iQj81rDfAwAA__9xBRsO">