delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/01/15/18:29:44

From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10301152331.AA25147@clio.rice.edu>
Subject: Re: sigaltstack()
To: djgpp-workers AT delorie DOT com
Date: Wed, 15 Jan 2003 17:31:50 -0600 (CST)
In-Reply-To: <1042666298005458@lycos-europe.com> from "Ben Decker" at Jan 15, 2003 10:31:38 PM
X-Mailer: ELM [version 2.5 PL2]
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> According to the man pages:
> "sigstack() is to be obsoleted at a future date.
> 
> "A portable application, when being written or rewritten, should use sigaltstack() instead 
> of sigstack()."

It appears sigaltstack is POSIX ...  older unixes may only have sigstack()
but aren't POSIX.  We should strive to be POSIX where possible.

While coding you might check for other sig* names which could be implemented
but are missing in DJGPP.

> The sigaltstack structure is defined as:
> struct sigaltstack {
>              char   *ss_sp;
>              int     ss_size;
>              int     ss_flags;
>      };
> (would this go in signal.h? ss_size may better be difined as size_t?)

This should be defined by POSIX where it goes and how it's defined.

> For Linux it was defined as:
> #define MINSIGSTKSZ     131027  /* min. stack size for sigaltstack() */
> #define SIGSTKSZ        262144  /* default stack size for sigaltstack() */

It's currently 8Kb for DJGPP

> GNU platforms seem to store the sigaltstack() routine itself in a separate 'sigaltstack.c'. 
> Would this also be suitable for DJGPP?

Probably - but the underlying structure which stores this information, so
it can actually be used - needs to be implemented in exceptn.S

What scares me is the assumptions made by swapping the signal stack may not
be correct (or needed) under DJGPP.  The signal handling system isn't
complete in the Unix sense.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019