/*  DO NOT EDIT THIS FILE.

    It has been auto-edited by fixincludes from:

	"/usr/include/sys/newsig.h"

    This had to be done to correct non-standard usages in the
    original, manufacturer supplied header file.  */

/*
 * BEGIN_DESC
 * 
 *  File: 
 *      @(#)B.11.11_LR	common/sys/newsig.h		$Revision: $
 * 
 *  Purpose:
 *	New header to enable ucontext.h to include it and signal.h to
 *	include it without have inclusion order problems with ucontext.h 
 * 
 *  Classification:			Release to Release Consistency Req:
 *		<<please select one of the following:>>
 * 	kernel subsystem private		none
 * 	kernel private				none
 * 	kernel 3rd party private		limited source
 * 	public					binary & source
 * 
 *  BE header:  yes
 *
 *  Shipped:  yes
 *	/usr/include/sys/newsig.h
 *	/usr/conf/sys/newsig.h
 *
 *  <<please delete the following note if this is a "public" header>>
 *  NOTE:
 *	This header file contains information specific to the internals
 *	of the HP-UX implementation.  The contents of this header file
 *	are subject to change without notice.  Such changes may affect
 *	source code, object code, or binary compatibility between
 *	releases of HP-UX.  Code which uses the symbols contained within
 *	this header file is inherently non-portable (even between HP-UX
 *	implementations).
 * 
 * END_DESC  
*/


#ifndef _SYS_NEWSIG_INCLUDED /* allows multiple inclusion */
#define _SYS_NEWSIG_INCLUDED

#ifndef _SYS_STDSYMS_INCLUDED
#include <sys/stdsyms.h>
#endif   /* _SYS_STDSYMS_INCLUDED  */


#ifdef _INCLUDE_POSIX_SOURCE

#  ifdef _INCLUDE_HPUX_SOURCE
     typedef struct __sigset_t {
          unsigned int sigset[8];
     } sigset_t;
#  else /* not _INCLUDE_HPUX_SOURCE */
     typedef struct __sigset_t { 
	  unsigned int __sigset[8];
     } sigset_t;
#  endif /* _INCLUDE_HPUX_SOURCE */

#endif /* _INCLUDE_POSIX_SOURCE */


#ifdef _INCLUDE_XOPEN_SOURCE_EXTENDED
#include <sys/types.h>
#include <machine/save_state.h>	/* kernel src: <machine/sys/save_state.h> */

   typedef struct __stack {	/* Used with sigaltstack(). */
	void     *ss_sp;	/* specifies new base of signal stack */
	int      ss_flags;	/* specifies the new stack state */
	_hpux_size_t ss_size;	/* specifies the new stack size */
   } stack_t;


typedef save_state_t mcontext_t;

/*	Attention !!!!!!!.
**  	Modifying following structure has a dependency in _ucontext
**	struct define. For non HPUX_SOURCE code, member fields are
**	copied for XPG4v2 compliance. Hence, any change here MUST 
** 	be replicated in non HPUX_SOURCE _ucontext definition.
 */

struct __sub_ctxt {  /* extended signal context information */
	struct __ucontext *__uc_link; /* pointer to context that will 
				       * be resumed when this 
				       * context returns.
			   	       */	
	sigset_t __uc_sigmask;   /* defines the set of signals that are 
			          * blocked when this context is active.
			          */
	stack_t __uc_stack;      /* defines the stack used by the 
			          * context 
				  */
};
typedef struct __sub_ctxt __sub_ctxt_t;

# if defined (_INCLUDE_HPUX_SOURCE)

typedef struct __ucontext {  /* structure that defines a process context */
	mcontext_t uc_mcontext;   /* the saved set of machine registers */
	int uc_spares[8];  	  /* extra space */
				  /* context was created by getcontext() */
	unsigned int uc_created_by_getcontext:1;  
	unsigned int uc_reserved_flags:31;    /* miscellaneous flags */
	struct __sub_ctxt uc_subcontext;

} ucontext_t;

#  define uc_link uc_subcontext.__uc_link
#  define uc_sigmask uc_subcontext.__uc_sigmask
#  define uc_stack uc_subcontext.__uc_stack

# else	/* NOT _INCLUDE_HPUX_SOURCE */

typedef struct __ucontext {  /* structure that defines a process context */
	mcontext_t uc_mcontext;   /* the saved set of machine registers */
	int uc_spares[8];  	  /* extra space */
				  /* context was created by getcontext() */
	unsigned int uc_created_by_getcontext:1;  
	unsigned int uc_reserved_flags:31;    /* miscellaneous flags */
	struct __ucontext *uc_link; /* pointer to context that will 
				       * be resumed when this 
				       * context returns.
			   	       */	
	sigset_t uc_sigmask;   /* defines the set of signals that are 
			          * blocked when this context is active.
			          */
	stack_t uc_stack;      /* defines the stack used by the 
			          * context 
				  */
} ucontext_t;

# endif	/*  _INCLUDE_HPUX_SOURCE */

#endif /* _INCLUDE_XOPEN_SOURCE_EXTENDED */

#endif /* _SYS_NEWSIG_INCLUDED */
