<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/89443>89443</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc][gnu ext] implement pthread_rwlockattr_{get|set}kind_np
</td>
</tr>
<tr>
<th>Labels</th>
<td>
good first issue,
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nickdesaulniers
</td>
</tr>
</table>
<pre>
These functions are perhaps useful. Not implemented in #89322 because I didn't know they existed.
Since these aren't POSIX but instead gnu extensions, these should go in FOO rather than libc/spec/posix.td; we already have an entry for pthreads.h in that file. It will be easier for someone to start on this once #89322 lands.
I would extend our definition of `pthread_rwlockattr_t` in libc/include/llvm-libc-types/pthread_rwlockattr_t.h to include a new `int` member named `pref` such that these functions are simple getters and setters.
Then it sounds like we should define 3 macros (in libc/include/pthread.h.def, though keep an eye on https://github.com/llvm/llvm-project/issues/88997, too)
- PTHREAD_RWLOCK_PREFER_READER_NP
- PTHREAD_RWLOCK_PREFER_WRITER_NP
- PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVF2P6jYT_jXmZrQRcRJCLnKxu4Be9FYLYrc9vUNOPIldHDvyOIfl31cOtEdHWlWqemOQPR_Px2QEke4tYs2KF1ZsFmIKyvna6vYikcRkrEZPi8bJW_2hkBC6ybZBO0sgPMKIXomRYCLsJpPAmwugh9HggDagBG2B8WxdZZxDg62YCGEPUkvLeBngYt0VgsIb4KemgDJhyw1bPt_Pd21bjM-Esdk95Xh43_8OzRRAWwooJPR2AvwMaCnCYvz1kULKTUZC7yKK3eEAXgSFHoISFoxuWsZ3NGL8GR3pzyRIlr3AFUEYj0LeQInvCMIC2uBv0DkPY1DxiRIViwYlAnTaYAKwD3DVxkCDgII0-jme3IDOIgQHFIQP4GKWJnCR2t_SGGEl_cR9D9cZ_UxMg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