| Issue |
242524
|
| Summary |
[libc] Implement POSIX.1-2024 sig2str and str2sig in <signal.h>
|
| Labels |
libc
|
| Assignees |
|
| Reporter |
amanmaurya92
|
### Feature Request
POSIX.1-2024 standardizes \sig2str\ and \str2sig\ in \<signal.h>\, along with the \SIG2STR_MAX\ macro constant.
These functions translate between signal numbers and signal name strings (without the \SIG\ prefix), replacing non-standard or locale-dependent utilities like \sys_siglist\.
- Standard reference: POSIX.1-2024 (IEEE Std 1003.1-2024), \<signal.h>\, \sig2str()\, \str2sig()\.'
- Signatures:
\\\c
int sig2str(int signum, char *str);
int str2sig(const char *restrict str, int *restrict signump);
\\\`n- Macro: \SIG2STR_MAX\ (maximum buffer size required for signal name string representation including null terminator).
We plan to implement \sig2str\, \str2sig\, and \SIG2STR_MAX\ in LLVM libc for Linux targets with comprehensive unit tests.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs