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