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

    <tr>
        <th>Summary</th>
        <td>
            [libc] add `pthread_rwlock_clockrdlock` and `pthread_rwlock_clockwrlock` GNU extensions
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue
      </td>
    </tr>

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

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

<pre>
    
> Function: `int pthread_rwlock_clockrdlock (pthread_rwlock_t *rwlock, clockid_t clockid, const struct timespec *abstime)`
> Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | See [POSIX Safety Concepts](https://www.gnu.org/software/libc/manual/html_node/POSIX-Safety-Concepts.html).
> Behaves like pthread_rwlock_timedrdlock except the time abstime is measured against the clock specified by clockid rather than CLOCK_REALTIME. Currently, clockid must be either CLOCK_MONOTONIC or CLOCK_REALTIME, otherwise EINVAL is returned.


> Function: `int pthread_rwlock_clockwrlock (pthread_rwlock_t *rwlock, clockid_t clockid, const struct timespec *abstime)`
> Preliminary: | MT-Safe | AS-Unsafe lock | AC-Unsafe lock | See [POSIX Safety Concepts](https://www.gnu.org/software/libc/manual/html_node/POSIX-Safety-Concepts.html).
> Behaves like pthread_rwlock_timedwrlock except the time abstime is measured against the clock specified by clockid rather than CLOCK_REALTIME. Currently, clockid must be either CLOCK_MONOTONIC or CLOCK_REALTIME, otherwise EINVAL is returned.

These should be easy to do since we already have all the abilities to handle realtime and monolithic clocks. See:
https://github.com/llvm/llvm-project/blob/9b02b75c4d035192d9f24038f70107d7ffbb0f77/libc/src/pthread/pthread_rwlock_timedwrlock.cpp#L31

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzslcFu4zYQhp-Gvgws0JRkWQcdHCcqgibxos4WRS8GRY4sdinSIKl4_fYF6Rjepl2gPfRS9EJT1D-jme8fmNx7dTCIDSnvSHk_41MYrGt2YnBWKnNA9-swzTorzw2h94SuSf4A7WREUNaQfA1kSZUJcAyDQy737qSt-LIXcXUyrkDY6sPbAIStL3vCNpDESu7DdZcOrfEBfHCTCBDUiP6IIsbxzsdHwmqypLeaPjnUalSGu3Mqq9rA8-t8x3tM-_Vu_tn4-HSpKR5t_nS0QwRS3n3a7h5_gRgbzrCxRuAxeFLeE7YaQjh6kq8JawlrT6dTdjBTZt2BsNbbPpy4Q8JarTpBWDtyM3FNWDuEUe-NlfFdyj6_ZJ9fs2dRQVid3Tq6w4G_oQetvuBHvpGAfOeLX2MGCAMmTvAOCJSHEbmfHErgB64izyhKkCHiVL1CCd35yh0cDwM6CAM3sHnabn7c__Swfnp9fH7IYDM5hybo8zeWwTj5AB0CqhR4iXnevmxfty-PG7DuQ5oYa6P0pDzCw-PLz-unWKjDMDmD8tr-t-vfH7iT-3_g_s2Be-f7nx241wE9gh_spGX6CPdnCBakBa-MQDghcB2xnCGiAq516pB3Squg0Ef1wI3UCA65vuAxEkZrrFZhUOLSic-i9dHW9OE_mnxQYZi6TNgxGqvfrj_zo7O_oQiEtZ22HWFt3VHWVaUoJM3LRc1k3bOC5qu-ogtayarvu472VXUbEO_i-m7ubfcXNmfieCQsf8oXlxpnssllndd8hs2iYotiUVer5WxoyrxfrkpW9VVH64IuK1EwSmkvEEtRsXqmGkZZQatFzSiti2VW5nle9ou8RImrvuCkoDhypbPYZZztmfJ-wqaul3U107xD7dMFxdjBWgm9cj5A0hDG4rXlmgSomw6eFFQrH_wtWVBBpwsuMSjvgUsZ_0a-f2eRJU22fUd0ARRFP7x8Bvwa0HhljZ9NTjf_2MvUh49upnbfGvZ7AAAA__9-54RR">