00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #if __GNUC__ >= 3
00021 @PRAGMA_SYSTEM_HEADER@
00022 #endif
00023 @PRAGMA_COLUMNS@
00024
00025 #if defined __need_sig_atomic_t || defined __need_sigset_t
00026
00027
00028 # @INCLUDE_NEXT@ @NEXT_SIGNAL_H@
00029
00030 #else
00031
00032
00033 #ifndef _GL_SIGNAL_H
00034
00035
00036 #@INCLUDE_NEXT@ @NEXT_SIGNAL_H@
00037
00038 #ifndef _GL_SIGNAL_H
00039 #define _GL_SIGNAL_H
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #include <sys/types.h>
00050
00051
00052
00053
00054 #if ! @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
00055 # if !GNULIB_defined_sig_atomic_t
00056 typedef int rpl_sig_atomic_t;
00057 # undef sig_atomic_t
00058 # define sig_atomic_t rpl_sig_atomic_t
00059 # define GNULIB_defined_sig_atomic_t 1
00060 # endif
00061 #endif
00062
00063
00064 #if !@HAVE_SIGSET_T@
00065 # if !GNULIB_defined_sigset_t
00066 typedef unsigned int sigset_t;
00067 # define GNULIB_defined_sigset_t 1
00068 # endif
00069 #endif
00070
00071
00072 #if @GNULIB_SIGNAL_H_SIGPIPE@
00073 # ifndef SIGPIPE
00074
00075 # define SIGPIPE 13
00076 # define GNULIB_defined_SIGPIPE 1
00077
00078
00079 # endif
00080 #endif
00081
00082
00083
00084 #ifndef NSIG
00085 # if defined __TANDEM
00086 # define NSIG 32
00087 # endif
00088 #endif
00089
00090
00091 #if @GNULIB_SIGPROCMASK@
00092 # if !@HAVE_POSIX_SIGNALBLOCKING@
00093
00094
00095 # ifndef NSIG
00096 # define NSIG 32
00097 # endif
00098
00099
00100 # if !GNULIB_defined_verify_NSIG_constraint
00101 typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
00102 # define GNULIB_defined_verify_NSIG_constraint 1
00103 # endif
00104
00105 # endif
00106
00107
00108 # if @HAVE_POSIX_SIGNALBLOCKING@
00109
00110 # if defined __cplusplus && defined GNULIB_NAMESPACE
00111 # undef sigismember
00112 # endif
00113 # else
00114 _GL_FUNCDECL_SYS (sigismember, int, (const sigset_t *set, int sig)
00115 _GL_ARG_NONNULL ((1)));
00116 # endif
00117 _GL_CXXALIAS_SYS (sigismember, int, (const sigset_t *set, int sig));
00118 _GL_CXXALIASWARN (sigismember);
00119
00120
00121 # if @HAVE_POSIX_SIGNALBLOCKING@
00122
00123 # if defined __cplusplus && defined GNULIB_NAMESPACE
00124 # undef sigemptyset
00125 # endif
00126 # else
00127 _GL_FUNCDECL_SYS (sigemptyset, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
00128 # endif
00129 _GL_CXXALIAS_SYS (sigemptyset, int, (sigset_t *set));
00130 _GL_CXXALIASWARN (sigemptyset);
00131
00132
00133 # if @HAVE_POSIX_SIGNALBLOCKING@
00134
00135 # if defined __cplusplus && defined GNULIB_NAMESPACE
00136 # undef sigaddset
00137 # endif
00138 # else
00139 _GL_FUNCDECL_SYS (sigaddset, int, (sigset_t *set, int sig)
00140 _GL_ARG_NONNULL ((1)));
00141 # endif
00142 _GL_CXXALIAS_SYS (sigaddset, int, (sigset_t *set, int sig));
00143 _GL_CXXALIASWARN (sigaddset);
00144
00145
00146 # if @HAVE_POSIX_SIGNALBLOCKING@
00147
00148 # if defined __cplusplus && defined GNULIB_NAMESPACE
00149 # undef sigdelset
00150 # endif
00151 # else
00152 _GL_FUNCDECL_SYS (sigdelset, int, (sigset_t *set, int sig)
00153 _GL_ARG_NONNULL ((1)));
00154 # endif
00155 _GL_CXXALIAS_SYS (sigdelset, int, (sigset_t *set, int sig));
00156 _GL_CXXALIASWARN (sigdelset);
00157
00158
00159 # if @HAVE_POSIX_SIGNALBLOCKING@
00160
00161 # if defined __cplusplus && defined GNULIB_NAMESPACE
00162 # undef sigfillset
00163 # endif
00164 # else
00165 _GL_FUNCDECL_SYS (sigfillset, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
00166 # endif
00167 _GL_CXXALIAS_SYS (sigfillset, int, (sigset_t *set));
00168 _GL_CXXALIASWARN (sigfillset);
00169
00170
00171 # if !@HAVE_POSIX_SIGNALBLOCKING@
00172 _GL_FUNCDECL_SYS (sigpending, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
00173 # endif
00174 _GL_CXXALIAS_SYS (sigpending, int, (sigset_t *set));
00175 _GL_CXXALIASWARN (sigpending);
00176
00177
00178
00179
00180
00181
00182 # if !@HAVE_POSIX_SIGNALBLOCKING@
00183 # define SIG_BLOCK 0
00184 # define SIG_SETMASK 1
00185 # define SIG_UNBLOCK 2
00186 _GL_FUNCDECL_SYS (sigprocmask, int,
00187 (int operation, const sigset_t *set, sigset_t *old_set));
00188 # endif
00189 _GL_CXXALIAS_SYS (sigprocmask, int,
00190 (int operation, const sigset_t *set, sigset_t *old_set));
00191 _GL_CXXALIASWARN (sigprocmask);
00192
00193
00194
00195 # ifdef __cplusplus
00196 extern "C" {
00197 # endif
00198 # if !GNULIB_defined_function_taking_int_returning_void_t
00199 typedef void (*_gl_function_taking_int_returning_void_t) (int);
00200 # define GNULIB_defined_function_taking_int_returning_void_t 1
00201 # endif
00202 # ifdef __cplusplus
00203 }
00204 # endif
00205 # if !@HAVE_POSIX_SIGNALBLOCKING@
00206 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00207 # define signal rpl_signal
00208 # endif
00209 _GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t,
00210 (int sig, _gl_function_taking_int_returning_void_t func));
00211 _GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t,
00212 (int sig, _gl_function_taking_int_returning_void_t func));
00213 # else
00214 _GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t,
00215 (int sig, _gl_function_taking_int_returning_void_t func));
00216 # endif
00217 _GL_CXXALIASWARN (signal);
00218
00219
00220 # if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE
00221 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00222 # undef raise
00223 # define raise rpl_raise
00224 # endif
00225 _GL_FUNCDECL_RPL (raise, int, (int sig));
00226 _GL_CXXALIAS_RPL (raise, int, (int sig));
00227 # else
00228 _GL_CXXALIAS_SYS (raise, int, (int sig));
00229 # endif
00230 _GL_CXXALIASWARN (raise);
00231
00232 #elif defined GNULIB_POSIXCHECK
00233 # undef sigaddset
00234 # if HAVE_RAW_DECL_SIGADDSET
00235 _GL_WARN_ON_USE (sigaddset, "sigaddset is unportable - "
00236 "use the gnulib module sigprocmask for portability");
00237 # endif
00238 # undef sigdelset
00239 # if HAVE_RAW_DECL_SIGDELSET
00240 _GL_WARN_ON_USE (sigdelset, "sigdelset is unportable - "
00241 "use the gnulib module sigprocmask for portability");
00242 # endif
00243 # undef sigemptyset
00244 # if HAVE_RAW_DECL_SIGEMPTYSET
00245 _GL_WARN_ON_USE (sigemptyset, "sigemptyset is unportable - "
00246 "use the gnulib module sigprocmask for portability");
00247 # endif
00248 # undef sigfillset
00249 # if HAVE_RAW_DECL_SIGFILLSET
00250 _GL_WARN_ON_USE (sigfillset, "sigfillset is unportable - "
00251 "use the gnulib module sigprocmask for portability");
00252 # endif
00253 # undef sigismember
00254 # if HAVE_RAW_DECL_SIGISMEMBER
00255 _GL_WARN_ON_USE (sigismember, "sigismember is unportable - "
00256 "use the gnulib module sigprocmask for portability");
00257 # endif
00258 # undef sigpending
00259 # if HAVE_RAW_DECL_SIGPENDING
00260 _GL_WARN_ON_USE (sigpending, "sigpending is unportable - "
00261 "use the gnulib module sigprocmask for portability");
00262 # endif
00263 # undef sigprocmask
00264 # if HAVE_RAW_DECL_SIGPROCMASK
00265 _GL_WARN_ON_USE (sigprocmask, "sigprocmask is unportable - "
00266 "use the gnulib module sigprocmask for portability");
00267 # endif
00268 #endif
00269
00270
00271 #if @GNULIB_SIGACTION@
00272 # if !@HAVE_SIGACTION@
00273
00274 # if !@HAVE_SIGINFO_T@
00275
00276 # if !GNULIB_defined_siginfo_types
00277
00278
00279 union sigval
00280 {
00281 int sival_int;
00282 void *sival_ptr;
00283 };
00284
00285
00286 struct siginfo_t
00287 {
00288 int si_signo;
00289 int si_code;
00290 int si_errno;
00291 pid_t si_pid;
00292 uid_t si_uid;
00293 void *si_addr;
00294 int si_status;
00295 long si_band;
00296 union sigval si_value;
00297 };
00298 typedef struct siginfo_t siginfo_t;
00299
00300 # define GNULIB_defined_siginfo_types 1
00301 # endif
00302
00303 # endif
00304
00305
00306
00307
00308 # if !GNULIB_defined_struct_sigaction
00309
00310 struct sigaction
00311 {
00312 union
00313 {
00314 void (*_sa_handler) (int);
00315
00316
00317
00318
00319 void (*_sa_sigaction) (int, siginfo_t *, void *);
00320 } _sa_func;
00321 sigset_t sa_mask;
00322
00323 int sa_flags;
00324 };
00325 # define sa_handler _sa_func._sa_handler
00326 # define sa_sigaction _sa_func._sa_sigaction
00327
00328 # define SA_RESETHAND 1
00329 # define SA_NODEFER 2
00330 # define SA_RESTART 4
00331
00332 # define GNULIB_defined_struct_sigaction 1
00333 # endif
00334
00335 _GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict,
00336 struct sigaction *restrict));
00337
00338 # elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@
00339
00340 # define sa_sigaction sa_handler
00341
00342 # endif
00343
00344 _GL_CXXALIAS_SYS (sigaction, int, (int, const struct sigaction *restrict,
00345 struct sigaction *restrict));
00346 _GL_CXXALIASWARN (sigaction);
00347
00348 #elif defined GNULIB_POSIXCHECK
00349 # undef sigaction
00350 # if HAVE_RAW_DECL_SIGACTION
00351 _GL_WARN_ON_USE (sigaction, "sigaction is unportable - "
00352 "use the gnulib module sigaction for portability");
00353 # endif
00354 #endif
00355
00356
00357 #ifndef SA_NODEFER
00358 # define SA_NODEFER 0
00359 #endif
00360
00361
00362 #endif
00363 #endif
00364 #endif