summaryrefslogtreecommitdiff
path: root/src/cmd/ksh93/features/sigfeatures
blob: 58beaf8daaf9c1a8e86cdc1b9b7d8efead4d1768 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
lib	sigblock,sigrelse,sigsetmask,sigprocmask,sigvec
typ	sigset_t	ast.h signal.h
mem	sigvec.sv_mask	signal.h
cat{
	#ifndef _mem_sigvec_sv_mask
	#   undef _lib_sigvec
	#endif
	#ifdef _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
	#   ifndef _lib_sigblock
	#	define sigblock(s)
	#   endif
	#   ifdef _lib_sigsetmask
	#       define sigrelease(s)  sigsetmask(0)
	#       define sig_begin()    sigsetmask(0)
	#   else
	#	ifdef _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()
	{
	#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