[PATCH 2/5] signal: Move sys_siglist to a compat symbol
Florian Weimer
fw@deneb.enyo.de
Tue Apr 28 15:11:35 GMT 2020
* Adhemerval Zanella via Libc-alpha:
> On 28/04/2020 11:50, Florian Weimer wrote:
>> * Adhemerval Zanella via Libc-alpha:
>>
>>> diff --git a/signal/signal.h b/signal/signal.h
>>> index fa8de963f8..3739550e5f 100644
>>> --- a/signal/signal.h
>>> +++ b/signal/signal.h
>>> @@ -281,12 +281,6 @@ extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val)
>>>
>>> #ifdef __USE_MISC
>>>
>>> -/* Names of the signals. This variable exists only for compatibility.
>>> - Use `strsignal' instead (see <string.h>). */
>>> -extern const char *const _sys_siglist[_NSIG];
>>> -extern const char *const sys_siglist[_NSIG];
>>
>> This is yet another removal without a formal deprecation warning. Do
>> we really want to do this? mutt does not yet use strsignal, for
>> example.
>>
>
> At least for mutt, on the latest 1.13.5 version it will use sys_siglist
> iff for !HAVE_STRERROR and its configure does check for strerror (on
> Linux HAVE_STRERROR will be set to 1).
sys_siglist and HAVE_STRERROR?
I see this in the mutt 1.13.2 sources:
signal.c-73-/* Attempt to catch "ordinary" signals and shut down gracefully. */
signal.c-74-static void exit_handler (int sig)
signal.c-75-{
signal.c-76- curs_set (1);
signal.c-77- endwin (); /* just to be safe */
signal.c-78-
signal.c-79- exit_print_string ("Caught signal ");
signal.c-80-#if SYS_SIGLIST_DECLARED
signal.c:81: exit_print_string (sys_siglist[sig]);
signal.c-82-#else
signal.c-83-#if (__sun__ && __svr4__)
signal.c:84: exit_print_string (_sys_siglist[sig]);
signal.c-85-#else
signal.c-86-#if (__alpha && __osf__)
signal.c:87: exit_print_string (__sys_siglist[sig]);
signal.c-88-#else
signal.c-89- exit_print_int (sig);
signal.c-90-#endif
signal.c-91-#endif
signal.c-92-#endif
signal.c-93- exit_print_string ("... Exiting.\n");
signal.c-94- exit (0);
signal.c-95-}
The code in neomutt is different, but uses the same libc facilities.
> In any case, I still think we should move sig_siglist to compat symbols.
> Although its usage is mitigated by current trend to use PIE, copy
> relocation are still problematic. And it to fix mips NSIG definition
> would require to add a net 2.32 compat version for the symbol, which
> I really would like to avoid.
Hmm.
Other thoughts on this? The header clearly said to use strsignal.
More information about the Libc-alpha
mailing list