Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
convert svn logs into ChangeLog (up to r7858 for now)
[simgrid.git] / tools / tesh2 / include / xsignal.h
1 #ifndef __XSIGNAL_H\r
2 #define __XSIGNAL_H\r
3 \r
4 #include <signal.h>\r
5 #include <com.h>\r
6     \r
7 #ifdef __cplusplus\r
8 extern "C" {
9   \r
10 #endif  /* \r */
11   \r
12 #ifdef _XBT_WIN32\r
13   \r
14 /* terminal line hangup                                                 */ \r
15 #ifndef SIGHUP\r
16 #define SIGHUP          1\r
17 #endif  /* \r */
18   \r
19 /* interrupt program                                                    */ \r
20 #ifndef SIGINT\r
21 #define SIGINT          2\r
22 #endif  /* \r */
23   \r
24 /* quit program                                                                 */ \r
25 #ifndef SIGQUIT\r
26 #define SIGQUIT         3\r
27 #endif  /* \r */
28   \r
29 /* illegal instruction                                                  */ \r
30 #ifndef SIGILL\r
31 #define SIGILL          4\r
32 #endif  /* \r */
33   \r
34 /* trace trap                                                                   */ \r
35 #ifndef SIGTRAP\r
36 #define SIGTRAP         5\r
37 #endif  /* \r */
38   \r
39 /* abnormal termination triggered by abort call */ \r
40 #ifndef SIGABRT\r
41 #define SIGABRT         6\r
42 #endif  /* \r */
43   \r
44 /* floating point exception                                             */ \r
45 #ifndef SIGFPE\r
46 #define SIGFPE          8\r
47 #endif  /* \r */
48   \r
49 /* kill program                                                                 */ \r
50 #ifndef SIGKILL\r
51 #define SIGKILL         9\r
52 #endif  /* \r */
53   \r
54 /* bus error                                                                    */ \r
55 #ifndef SIGBUS\r
56 #define SIGBUS          10\r
57 #endif  /* \r */
58   \r
59 /* segment violation                                                    */ \r
60 #ifndef SIGSEGV\r
61 #define SIGSEGV         11\r
62 #endif  /* \r */
63   \r
64 /* non-existent system call invoked                             */ \r
65 #ifndef SIGSYS\r
66 #define SIGSYS          12\r
67 #endif  /* \r */
68   \r
69 /* write on a pipe with no reader                               */ \r
70 #ifndef SIGPIPE\r
71 #define SIGPIPE         13\r
72 #endif  /* \r */
73   \r
74 /* real-time timer expired                                              */ \r
75 #ifndef SIGALRM\r
76 #define SIGALRM         14\r
77 #endif  /* \r */
78   \r
79 /* software termination signal from kill                        */ \r
80 #ifdef  SIGTERM\r
81 #define SIGTERM         15\r
82 #endif  /* \r */
83   \r
84 /* urgent condition present on socket                           */ \r
85 #ifndef SIGURG\r
86 #define SIGURG          16\r
87 #endif  /* \r */
88   \r
89 /* stop (cannot be caught orignored)                            */ \r
90 #ifndef SIGSTOP\r
91 #define SIGSTOP         17\r
92 #endif  /* \r */
93   \r
94 /* stop signal generated from keyboard                          */ \r
95 #ifndef SIGTSTP\r
96 #define SIGTSTP         18\r
97 #endif  /* \r */
98   \r
99 /* continue after stop                                                          */ \r
100 #ifndef SIGCONT\r
101 #define SIGCONT         19\r
102 #endif  /* \r */
103   \r
104 /* child status has changed                                                     */ \r
105 #ifndef SIGCHLD\r
106 #define SIGCHLD         20\r
107 #endif  /* \r */
108   \r
109 /* background read attempted from control terminal      */ \r
110 #ifndef SIGTTIN\r
111 #define SIGTTIN         21\r
112 #endif  /* \r */
113   \r
114 /* background write attempted to control terminal       */ \r
115 #ifndef SIGTTOU\r
116 #define SIGTTOU         22\r
117 #endif  /* \r */
118   \r
119 /* I/O is possible on a descriptor see fcntl(2))        */ \r
120 #ifndef SIGIO\r
121 #define SIGIO           23\r
122 #endif  /* \r */
123   \r
124 /* cpu time limit exceeded (see setrlimit(2))           */ \r
125 #ifndef SIGXCPU\r
126 #define SIGXCPU         24\r
127 #endif  /* \r */
128   \r
129 /* file size limit exceeded (see setrlimit(2))          */ \r
130 #ifndef SIGXFSZ\r
131 #define SIGXFSZ         25\r
132 #endif  /* \r */
133   \r
134 /* virtual time alarm (see setitimer(2))                        */ \r
135 #ifndef SIGVTALRM\r
136 #define SIGVTALRM       26\r
137 #endif  /* \r */
138   \r
139 /* profiling timer alarm (see setitimer(2))                     */ \r
140 #ifndef SIGPROF\r
141 #define SIGPROF         27\r
142 #endif  /* \r */
143   \r
144 /*  window size change                                                          */ \r
145 #ifndef SIGWINCH\r
146 #define SIGWINCH        28\r
147 #endif  /* \r */
148   \r
149 /* user defined signal 1                                                        */ \r
150 #ifndef SIGUSR1\r
151 #define SIGUSR1         30\r
152 #endif  /* \r */
153   \r
154 /* user defined signal 2                                                        */ \r
155 #ifndef SIGUSR2\r
156 #define SIGUSR2         31\r
157 #endif  /* \r */
158   \r \r int \r is_an_unhandled_exception(DWORD exit_code);
159   \r \r
160 /*  \r
161  *return a non-zero value if status was returned for a child process that terminated normally. \r
162  */ \r
163 #define WIFEXITED(__status)             !is_an_unhandled_exception((__status))\r
164   \r
165 /* if the value of WIFEXITED(__status) is non-zero, this macro evaluates the value the child \r
166  * process returned from main().\r
167  */ \r
168 #define WEXITSTATUS(__status)   (__status)\r
169   \r
170 /* return a non-zero value if status was returned for a child process that terminated due to the \r
171  * receipt of a signal that was not caught \r
172  */ \r
173 #define WIFSIGNALED(__status)   is_an_unhandled_exception((__status))\r
174   \r
175 /* if the value of WIFSIGNALED(__status) is non-zero, this macro evaluates to the number of the \r
176  * signal that caused the termination of the child process.\r
177  */ \r
178 #define WTERMSIG(__status)              (__status)\r
179   \r
180 #endif  /* _XBT_WIN32 */\r
181   \r \r
182 #ifdef _XBT_WIN32\r
183   const char *\r signal_name(DWORD got, const char *expected);
184   \r
185 #else   /* \r */
186   const char *\r signal_name(unsigned int got, char *expected);
187   \r
188 #endif  /* \r */
189   \r\rint \r sig_exists(const char *sig_name);
190   \r\r
191 #ifdef __cplusplus\r
192\r
193 #endif  /* \r */
194 \r
195 #endif  /* !__XSIGNAL_H */\r