<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/124032>124032</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc] pthread_setspecific has wrong fn signature in generated header
</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>
impl looks correct, generated header looks incorrect:
```c
void * pthread_setspecific(pthread_key_t, const void *) __NOEXCEPT;
```
fix libc/include/pthread.yaml for `pthread_setspecific` should return `int`, not `void*`.
Otherwise the following error is observed when building libcxxabi against llvm-libc:
```
/llvm-project-main/build/include/c++/v1/__thread/support/pthread.h:216:10: error: cannot initialize return object of type 'int' with an rvalue of type 'void *'
216 | return pthread_setspecific(__key, __p);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8U7GSpDYQ_Zom6bop0QzMERCwc0voc-DAGSVEA_JqJEoSM7sO_O0uMTt1e_bWqRSopNbr169fyxD0bJkbKJ-g_JbJLS7ON1arl5GD3IzV7EM2uPGt0ZfVoHHuJaBy3rOKQGec2bKXkUdcWI7s3yO0fcQULYgWKnHfCkR7dXpEoBbXuHiWYx84hpWVnrQC-vq4feG3fk-hnA0RH7-Aauz7374__3l-_v0PKJ4-woNoJ_2KRg8KqNNWmW1koO4d8_AmLwYn5xEq8Vn2SmBY3GZG9Bw3b1OctjEh0xmti-kiMUlEKnFIuUX7PS7sbzowxoVxcsa4m7YzsvfOow7ohsD-yiPeFrY4bNqM6T3RfH2Vg0Y5S52KNOZ6-bKz_1m2dKZuf129-4tV_HKR2gJ1O9hPtSqgp3131xyo6_t7nUBd2NbV-fhBjwWKlvIKijYXULR3xumgpE3Vaqujlkb_zQ9B3JCyo5swvq2MQKekD53wpuOC0qK_SrPxx4AfnTuBaBEprxBOZ8QH5uc-6JMDkux9vwLV907jvtJvKJ__-eX6qF82NsVYF7XMuMlPxamsxakqsqWpC6rV19NAIi_ykioumJWaSlLH8ZjzMdMNCSpFToUQohLFoRKqlmU-HYeBSdYTHAVfpDaH1J2D83OmQ9i4yekoCsqMHNiEfb6IZudGnLQPEfcgIAI6A9HdsJRG0Dd7m4dtDnAURocYfkBHHc0-rPuH8ttn0uEiA968szNOFtN8y7h5Rm3_N6zZ5k2zxLiG5DfqgLpZx2UbDspd3g33H98lqyXqAah7L_Ha0L8BAAD__xkZZSs">