Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Proposal: new libc/libutil functions to map SIGXXXX <-> "XXXX"



On Fri, Apr 28, 2017 at 09:01:59AM +0700, Robert Elz wrote:
> LIBRARY
>      Standard C Library (libc, -lc)
> 
> SYNOPSIS
>      #include <signal.h>
> 
>      int
>      signame(int sig, char *name, size_t namelen);
> 
>      int
>      signumber(const char *name);

libc is fine. I'd call it signalnumber and signalname, but ok. Do we
really need to deal with dynamic signal numbers? I'd just make it

    const char *signame(int sig) __pure

and if the application wants to use its own buffer, it can then
str(l)cpy or strdup it.

Joerg


Home | Main Index | Thread Index | Old Index