This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fwd: What can a signal handler do with SIGSTKSZ?


On 1/14/19 11:34 AM, Zack Weinberg wrote:
> For this new interface, the backward compatibility concerns I raised
> regarding what you can do in MINSIGSTKSZ don't necessarily apply, and
> it would make sense for it to be truly a minimum.  I would suggest we
> define "minimum" in terms of what the C standard - not POSIX - allows
> you to do in a signal handler, which is almost nothing:  you're
> guaranteed to have enough space in sysconf(_SC_MINSIGSTKSZ) for this:
> 
>     static volatile sig_atomic_t signal_flag = 0;
>     static void handler(int unused)
>     {
>        flag = 1;
>     }
> 
> and this:
> 
>    static atomic_uint signal_count = 0;
>    static void handler (int unused)
>    {
>       atomic_fetch_add (&signal_count, 1);
>    }

By my reading we'd also have to support:  abort, _Exit, 
quick_exit, and signal.

What I'm not quite sure about is that errno has visible
changes from these functions, particularly signal failing
and if we must also exercise writing to a TLS errno.

-- 
Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]