DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Release 7.1.1 new features

Signal Handling Changes

Signal handling has been modified in Release 7.1.1 to push an extended user context structure (uxcontext_t) on the user stack during signal processing.


NOTE: This consumes an extra 512 bytes of user stack space over what was previously used during signal handling. It is possible that programs which were close to exhausting their stack space may experience stack overflows as a result of this change.

When an extended user context structure with saved floating point state is pushed on the user stack, it will have both UC_FP and UC_FPX set in the uc_flags element, and the floating point state will be saved in two places in the extended user context. The i387 floating point state will be saved in the uc_mcontext.fpregs element and the extended floating point state will be saved in the __fpxregset element.

To determine the type of user context passed to the operating system upon returning from a signal handler, the kernel uses the first four bytes of the 16-byte padding (uc_filler) in both ucontext_t and uxcontext_t. The new structure element is:

   void *uc_ucontextp;

The uc_ucontextp pointer is used to save the user address at which a user context structure is pushed onto the user stack during signal handling. In all other cases, uc_contextp is set to NULL.

When a user context structure with both UC_FP and UC_FPX set in uc_flags is passed to the operating system via the setcontext(2) system call, the operating system checks the address saved in uc_ucontextp against the address of the user context it is being passed. If uc_ucontextp matches the address of the user context, the system assumes it is being passed an extended user context pushed on the user stack during signal handling. In this case, the operating system will set the extended floating point state and then overlay the i387 floating point state.

The i387 floating point state takes precedence because an application which does not know about the extended floating point state may have altered the contents of the i387 register state. If uc_ucontextp does not match the address of the user context passed to the setcontext system call, the operating system assumes it is being passed a copy of an extended user context that was made by an application that does not know about the extended floating point state. In this case, the system ignores the extended floating point state and treats the user context as being of type ucontext_t, restoring only the i387 floating point state.


NOTE: Applications which manipulate the saved extended floating point state from within signal handlers, must clear UC_FP in the uc_flags element of the user context structure before returning.


Next topic: New LWP status structure and procfs changes
Previous topic: New library functions and related changes

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 22 April 2004