[PATCH] Add typedef of stack_t for Cygwin

Joel Sherrill joel.sherrill@oarcorp.com
Tue Mar 31 23:20:00 GMT 2015


On 3/31/2015 10:43 AM, Jon TURNEY wrote:
> 	* libc/include/sys/signal.h (stack_t): Add typedef on Cygwin.
> ---
>   newlib/ChangeLog                 | 4 ++++
>   newlib/libc/include/sys/signal.h | 9 +++++++++
>   2 files changed, 13 insertions(+)
>
> diff --git a/newlib/ChangeLog b/newlib/ChangeLog
> index 8ded7ab..24571e5 100644
> --- a/newlib/ChangeLog
> +++ b/newlib/ChangeLog
> @@ -1,3 +1,7 @@
> +2015-03-30  Jon TURNEY  <jon.turney@dronecode.org.uk>
> +
> +	* libc/include/sys/signal.h (stack_t): Add typedef on Cygwin.
> +
>   2015-03-23  Sebastian Huber  <sebastian.huber@embedded-brains.de>
>   
>   	* libc/include/sys/tree.h: New file.
> diff --git a/newlib/libc/include/sys/signal.h b/newlib/libc/include/sys/signal.h
> index 7fc30a7..6340884 100644
> --- a/newlib/libc/include/sys/signal.h
> +++ b/newlib/libc/include/sys/signal.h
> @@ -138,6 +138,15 @@ typedef struct sigaltstack {
>   
>   #elif defined(__CYGWIN__)
>   #include <cygwin/signal.h>
> +
> +/*
> + * Structure used in sigaltstack call.
> + */
> +typedef struct sigaltstack {
> +  void     *ss_sp;    /* Stack base or pointer.  */
> +  int       ss_flags; /* Flags.  */
> +  size_t    ss_size;  /* Stack size.  */
> +} stack_t;
>   #else
>   #define SA_NOCLDSTOP 1  /* only value supported now for sa_flags */
>   
Why can't you move the definition that5 is there for RTEMS and use
it for both Cygwin and RTEMS? We have exactly the same definition
only a few lines above.

There is no point in duplicating this and when Cygwin and RTEMS
can use exactly the same code, I am personally much happier.

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the Newlib mailing list