This is the mail archive of the cygwin-patches mailing list for the Cygwin 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: [PATCH 2/2] Make CONTEXT available to signal handlers


On Mar 30 18:32, Jon TURNEY wrote:
> +typedef struct ucontext {
> +	mcontext_t	uc_mcontext;
> +} ucontext_t;

I liked that better as before.  Keep in mind that changing, improving
user-space provided structures practically always requires to add
code to account for old and for newly built applications, the ones
which only know the old struct layout, and the new ones knowning the
new layout.

Therefore we should define ucontext_t in a way which does not require
to change it later.  Looking at the Linux definition:

  typedef struct ucontext
  {
    unsigned long int uc_flags;
    struct ucontext *uc_link;
    stack_t uc_stack;
    mcontext_t uc_mcontext;
    __sigset_t uc_sigmask;
    struct _libc_fpstate __fpregs_mem;
  } ucontext_t;

We won't have __fpregs_mem, ever, since it's part of uc_mcontext (see
the comments in sys/ucontext.h) so this can be dropped.  But everything
else we can and should provide.  uc_link might come in handy as well at
one point, who knows?  Just set it to NULL for now.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpayX6T4dHmH.pgp
Description: PGP signature


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