RFC: Update MINSIGSTKSZ and SIGSTKSZ

H.J. Lu hjl.tools@gmail.com
Wed Oct 7 14:25:23 GMT 2020


On Wed, Sep 30, 2020 at 1:04 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Wed, Sep 30, 2020 at 10:27 AM Paul Eggert <eggert@cs.ucla.edu> wrote:
> >
> > On 9/29/20 2:49 PM, H.J. Lu wrote:
> > > What value do you have in mind?
> >
> > 64*1024
>
> So we change both SIGSTKSZ and MINSIGSTKSZ to 64KB.
>
> > > What if it is not big enough 20 years later?
> >
> > Then we change it later. We'll have plenty of time.
> >
> > > Constant SIGSTKSZ and MINSIGSTKSZ are from history.   They should be changed.
> >
> > Feel free to start the ball rolling at the POSIX level. In the meantime let's
> > keep conforming to POSIX, since programs depend on constant SIGSTKSZ now.
> > Changing POSIX will give application developers plenty of notice; changing glibc
> > now won't do that.
>
> We add _SC_RSVD_SIG_STACK_SIZE for signal stack size reserved by the kernel.
> Then we deprecate SIGSTKSZ and MINSIGSTKSZ if _SC_RSVD_SIG_STACK_SIZE
> is in use.
>

This isn't the first time for a constant changed to sysconf:

* ARG_MAX is not anymore constant on Linux.  Use sysconf(_SC_ARG_MAX).

We can do

* Add _SC_MINSIGSTKSZ and _SC_SIGSTKSZ.  When _SC_SIGSTKSZ_SOURCE is
  defined, MINSIGSTKSZ and SIGSTKSZ are no longer constant on Linux.
  MINSIGSTKSZ is redefined to sysconf(_SC_MINSIGSTKSZ) and SIGSTKSZ
  is redefined to sysconf (_SC_SIGSTKSZ).

With -D_SC_SIGSTKSZ_SOURCE, compilation will fail if the source assumes
constant MINSIGSTKSZ and SIGSTKSZ.

-- 
H.J.


More information about the Libc-alpha mailing list