sd: remove 'ssd' driver support
[unleashed/tickless.git] / usr / src / lib / libast / common / features / sig.sh
blob450f5c7c1b809fffa2fe4179942377f288610c78
1 ########################################################################
2 # #
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 #
8 # #
9 # A copy of the License is available at #
10 # http://www.opensource.org/licenses/cpl1.0.txt #
11 # (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
12 # #
13 # Information and Software Systems Research #
14 # AT&T Research #
15 # Florham Park NJ #
16 # #
17 # Glenn Fowler <gsf@research.att.com> #
18 # David Korn <dgk@research.att.com> #
19 # Phong Vo <kpv@research.att.com> #
20 # #
21 ########################################################################
22 : generate sig features
23 case $# in
24 0) ;;
25 *) eval $1
26 shift
28 esac
29 echo "#include <signal.h>
30 int xxx;" > $tmp.c
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
37 #else
38 #define kill ______kill
39 #define killpg ______killpg
40 #endif
41 #include <signal.h>
42 #if defined(__STDPP__directive) && defined(__STDPP__hide)
43 __STDPP__directive pragma pp:nohide kill killpg
44 #else
45 #undef kill
46 #undef killpg
47 #endif
48 #ifndef sigmask
49 #define sigmask(s) (1<<((s)-1))
50 #endif"
51 echo "#include <signal.h>
52 #ifdef TYPE
53 #if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
54 typedef TYPE (*Sig_handler_t)(ARG);
55 #else
56 typedef TYPE (*Sig_handler_t)();
57 #endif
58 #endif
59 Sig_handler_t f()
61 Sig_handler_t handler;
62 handler = signal(1, SIG_IGN);
63 return(handler);
64 }" > $tmp.c
65 if $cc -c $tmp.c >/dev/null
66 then :
67 else e=`wc -l $tmp.e`
68 i1= j1=
69 for i in void int
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 ;;
74 esac
75 case $i1 in
76 "") i1=$i j1=$j ;;
77 esac
78 done
79 done
80 case $i1 in
81 ?*) i=$i1 j=$j1 ;;
82 esac
83 echo "typedef $i (*Sig_handler_t)($j);"
85 echo '
87 #define Handler_t Sig_handler_t
89 #define SIG_REG_PENDING (-1)
90 #define SIG_REG_POP 0
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
97 typedef struct
99 char** name;
100 char** text;
101 int sigmax;
102 } Sig_info_t;
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__
109 #endif
110 #if !_BLD_ast && defined(__IMPORT__)
111 #define extern extern __IMPORT__
112 #endif
114 extern Sig_info_t sig_info;
116 #undef extern
118 #if _lib_sigflag && _npt_sigflag
119 extern int sigflag(int, int, int);
120 #endif
122 #if _BLD_ast && defined(__EXPORT__)
123 #define extern __EXPORT__
124 #endif
126 #if !_lib_sigflag
127 extern int sigflag(int, int, int);
128 #endif
129 extern int sigcritical(int);
130 extern int sigunblock(int);
132 #undef extern'