lib	sigblock,sigrelse,sigsetmask,sigprocmask,sigvec
typ	sigset_t	ast.h signal.h
mem	sigvec.sv_mask	signal.h
cat{
	#if !_mem_sigvec_sv_mask
	#   undef _lib_sigvec
	#endif
	#if _lib_sigprocmask
	#    define sh_sigaction(s,action) do { sigset_t ss;\
				sigemptyset(&ss); \
				if(s) sigaddset(&ss,(s)); \
				sigprocmask(action,&ss,0); \
				}while(0)
	#    define sigrelease(s)	sh_sigaction(s,SIG_UNBLOCK)
	#    define sigblock(s)	 	sh_sigaction(s,SIG_BLOCK)
	#    define sig_begin()		sh_sigaction(0,SIG_SETMASK)
	#else
	#   if !_lib_sigblock
	#	define sigblock(s)
	#   endif
	#   if _lib_sigsetmask
	#       define sigrelease(s)  sigsetmask(0)
	#       define sig_begin()    sigsetmask(0)
	#   else
	#	if _lib_sigrelse
	#	    define sigrelease	sigrelse
	#	    define sig_begin()
	#	else
	#	    define sig_begin()		(0)
	#	    define sigrelease(s)	(0)
	#	endif /* _lib_sigrelse */
	#    endif /* _lib_sigsetmask */
	#endif /* _lib_sigprocmask */
}end
tst	output{
	#include <signal.h>
	int main(void)
	{
	#ifdef SIGRTMIN
		printf("#undef	_SIGRTMIN\n");
		printf("#define _SIGRTMIN	%d\n", SIGRTMIN);
	#endif
	#ifdef SIGRTMAX
		printf("#undef	_SIGRTMAX\n");
		printf("#define _SIGRTMAX	%d\n", SIGRTMAX);
	#endif
		return 0;
	}
}end
