1 ########################################################################
3 # This software is part of the ast package #
4 # Copyright (c) 1985-2010 AT&T Intellectual Property #
5 # and is licensed under the #
6 # Common Public License, Version 1.0 #
7 # by AT&T Intellectual Property #
9 # A copy of the License is available at #
10 # http://www.opensource.org/licenses/cpl1.0.txt #
11 # (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
13 # Information and Software Systems Research #
17 # Glenn Fowler <gsf@research.att.com> #
18 # David Korn <dgk@research.att.com> #
19 # Phong Vo <kpv@research.att.com> #
21 ########################################################################
22 : generate sig features
29 echo "#include <signal.h>
31 $cc -c $tmp.c
>/dev
/null
2>$tmp.e
32 echo "#pragma prototyped
33 #define sig_info _sig_info_
35 #if defined(__STDPP__directive) && defined(__STDPP__hide)
36 __STDPP__directive pragma pp:hide kill killpg
38 #define kill ______kill
39 #define killpg ______killpg
42 #if defined(__STDPP__directive) && defined(__STDPP__hide)
43 __STDPP__directive pragma pp:nohide kill killpg
49 #define sigmask(s) (1<<((s)-1))
51 echo "#include <signal.h>
53 #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
54 typedef TYPE (*Sig_handler_t)(ARG);
56 typedef TYPE (*Sig_handler_t)();
61 Sig_handler_t handler;
62 handler = signal(1, SIG_IGN);
65 if $cc -c $tmp.c
>/dev
/null
70 do for j
in int
,... ... int
71 do $cc -c -DTYPE=$i -DARG=$j $tmp.c
>/dev
/null
2>$tmp.e ||
continue
72 case `wc -l $tmp.e` in
73 $e) i1
= j1
=; break 2 ;;
83 echo "typedef $i (*Sig_handler_t)($j);"
87 #define Handler_t Sig_handler_t
89 #define SIG_REG_PENDING (-1)
91 #define SIG_REG_EXEC 00001
92 #define SIG_REG_PROC 00002
93 #define SIG_REG_TERM 00004
94 #define SIG_REG_ALL 00777
95 #define SIG_REG_SET 01000
104 extern int kill(pid_t, int);
105 extern int killpg(pid_t, int);
107 #if _BLD_ast && defined(__EXPORT__)
108 #define extern extern __EXPORT__
110 #if !_BLD_ast && defined(__IMPORT__)
111 #define extern extern __IMPORT__
114 extern Sig_info_t sig_info;
118 #if _lib_sigflag && _npt_sigflag
119 extern int sigflag(int, int, int);
122 #if _BLD_ast && defined(__EXPORT__)
123 #define extern __EXPORT__
127 extern int sigflag(int, int, int);
129 extern int sigcritical(int);
130 extern int sigunblock(int);