xref: /titanic_51/usr/src/lib/libshell/common/features/sigfeatures (revision ff3124eff995e6cd8ebd8c6543648e0670920034)
1lib	sigblock,sigrelse,sigsetmask,sigprocmask,sigvec
2typ	sigset_t	ast.h signal.h
3mem	sigvec.sv_mask	signal.h
4cat{
5	#ifndef _mem_sigvec_sv_mask
6	#   undef _lib_sigvec
7	#endif
8	#ifdef _lib_sigprocmask
9	#    define sh_sigaction(s,action) do { sigset_t ss;\
10				sigemptyset(&ss);\
11				sigaddset(&ss,(s));\
12				sigprocmask(action,&ss,0); \
13				}while(0)
14	#    define sigrelease(s)	sh_sigaction(s,SIG_UNBLOCK)
15	#    define sigblock(s)	 	sh_sigaction(s,SIG_BLOCK)
16	#    define sig_begin()		sh_sigaction(0,SIG_SETMASK)
17	#else
18	#   ifndef _lib_sigblock
19	#	define sigblock(s)
20	#   endif
21	#   ifdef _lib_sigsetmask
22	#       define sigrelease(s)  sigsetmask(0)
23	#       define sig_begin()    sigsetmask(0)
24	#   else
25	#	ifdef _lib_sigrelse
26	#	    define sigrelease	sigrelse
27	#	    define sig_begin()
28	#	else
29	#	    define sig_begin()		(0)
30	#	    define sigrelease(s)	(0)
31	#	endif /* _lib_sigrelse */
32	#    endif /* _lib_sigsetmask */
33	#endif /* _lib_sigprocmask */
34}end
35tst	output{
36	#include <signal.h>
37	int main()
38	{
39	#ifdef SIGRTMIN
40		printf("#undef	_SIGRTMIN\n");
41		printf("#define _SIGRTMIN	%d\n", SIGRTMIN);
42	#endif
43	#ifdef SIGRTMAX
44		printf("#undef	_SIGRTMAX\n");
45		printf("#define _SIGRTMAX	%d\n", SIGRTMAX);
46	#endif
47		return 0;
48	}
49}end
50