<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/125598>125598</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc][signal] fix declaration of sighandler_t
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
nickdesaulniers
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nickdesaulniers
</td>
</tr>
</table>
<pre>
cross compiling our unit tests (built hermetically) with llvm-libc fails with:
```
llvm-project/libc/test/UnitTest/FPExceptMatcher.cpp:40:3: error: unknown type name 'sighandler_t'; did you mean '__sighandler_t'?
40 | sighandler_t oldSIGFPEHandler = signal(SIGFPE, &sigfpeHandler);
| ^~~~~~~~~~~~
| __sighandler_t
llvm-project/build_aarch64/libc/include/llvm-libc-types/struct_sigaction.h:28:16: note: '__sighandler_t' declared here
28 | typedef void (*__sighandler_t)(int);
| ^
```
it looks like our generated signal.h defines `sighandler_t` with two leading underscores (for some reason, 215c9fa4deac9ec6b4e504843830551f03b60620 seems related). Whatever the problem was should be revisited.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxslMFu4zYQhp9mfBmsQQ8lWTro4GzitocCC7RFjwFFjiw2FGmQlLO59NkLyl6k8YYwYIIzHP7459OolOzJM_dQPwCRt_rFcFKL85ZjAiKoHzdqyVOI_V1wMwTz1usYUkId5rN11p8wLBEXbzNmTjkhUDss1mWcOM6crVbOvQF1-GrzhM5d5i_ODhpHZV1aD0EeQBygEbefOKxZ5xj-YZ2BjiUf6FjqAx3_8jb_ed0evz1913zOv6usJ45bfT6DPFQC5EGCPCDHGGLZLP7Fh1eP-e3M6NXMCLRP9jQpbxzH5wy0B_mAxhp8CwvOrHxJeX7-KekI4oCIlUDYf8X_hzE488dvvxy_Pf16PUKQjyXDKwfUXkNAXxGoSfY0nvmWB9SBfLjWRVzrQv307_v6ELrT9JNbxX3zrFTUU1O9u2e9dovhcvCjB1-KHQnomHJcdC51lc42-G3pCbUgD7um2OdD5vL_mSNoWDsV2ZSG81UptavSUt7wiJdgTeEC6HB_vQNqrc-fOHC3oH66g8RmdCG8JHT2hVcKT-w5qszmZvp2QsOj9ZwQGvHh4UZcecyvAR0rU0BevOGYdIi8UjyGiCnMjJFVCr40jna17kZVGVa6Y90MFdeiaivZSlHXu1HIoRENCUzMc8LIrqgB6rb496QyXzhinhjPMQyOZ3xVCdMUFmdwKO9cbLKZzXZjemk62akN97u9bBuq9_tuM_WNNjWNQ0Vacav2xJrMXo2V6jomM9Qb25OgWpCQJGWz67aiq4ZWVnpsWdI4GKgEz8q6baFgG-JpY1NauN9RXXftxqmBXbrNhis560CI_UrNsJwSVMLZlNN7hWyzW-fJeqF-hPrhRn39iKP9fkNEFbQwjB8-ms0SXT_lfE5lDNAR6HiyeVqGrQ7zDdYfzL4zvmou5N5kX3r6LwAA___ws46g">