00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if __GNUC__ >= 3
00022 #pragma GCC system_header
00023 #endif
00024
00025
00026 #if defined __need_sig_atomic_t || defined __need_sigset_t
00027
00028
00029 # include_next <signal.h>
00030
00031 #else
00032
00033
00034 #ifndef _GL_SIGNAL_H
00035
00036
00037 #include_next <signal.h>
00038
00039 #ifndef _GL_SIGNAL_H
00040 #define _GL_SIGNAL_H
00041
00042
00043 #ifndef _GL_CXXDEFS_H
00044 #define _GL_CXXDEFS_H
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 #if defined __cplusplus
00108 # define _GL_EXTERN_C extern "C"
00109 #else
00110 # define _GL_EXTERN_C extern
00111 #endif
00112
00113
00114
00115
00116
00117
00118
00119
00120 #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
00121 _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
00122 #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
00123 _GL_EXTERN_C rettype rpl_func parameters_and_attributes
00124
00125
00126
00127
00128
00129
00130
00131
00132 #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
00133 _GL_EXTERN_C rettype func parameters_and_attributes
00134
00135
00136
00137
00138
00139
00140
00141 #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
00142 _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
00143 #if defined __cplusplus && defined GNULIB_NAMESPACE
00144 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
00145 namespace GNULIB_NAMESPACE \
00146 { \
00147 rettype (*const func) parameters = ::rpl_func; \
00148 } \
00149 _GL_EXTERN_C int _gl_cxxalias_dummy
00150 #else
00151 # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
00152 _GL_EXTERN_C int _gl_cxxalias_dummy
00153 #endif
00154
00155
00156
00157
00158
00159
00160 #if defined __cplusplus && defined GNULIB_NAMESPACE
00161 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
00162 namespace GNULIB_NAMESPACE \
00163 { \
00164 rettype (*const func) parameters = \
00165 reinterpret_cast<rettype(*)parameters>(::rpl_func); \
00166 } \
00167 _GL_EXTERN_C int _gl_cxxalias_dummy
00168 #else
00169 # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
00170 _GL_EXTERN_C int _gl_cxxalias_dummy
00171 #endif
00172
00173
00174
00175
00176
00177
00178
00179
00180 #if defined __cplusplus && defined GNULIB_NAMESPACE
00181
00182
00183
00184
00185
00186
00187 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
00188 namespace GNULIB_NAMESPACE \
00189 { \
00190 static rettype (*func) parameters = ::func; \
00191 } \
00192 _GL_EXTERN_C int _gl_cxxalias_dummy
00193 #else
00194 # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
00195 _GL_EXTERN_C int _gl_cxxalias_dummy
00196 #endif
00197
00198
00199
00200
00201
00202
00203 #if defined __cplusplus && defined GNULIB_NAMESPACE
00204 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
00205 namespace GNULIB_NAMESPACE \
00206 { \
00207 static rettype (*func) parameters = \
00208 reinterpret_cast<rettype(*)parameters>(::func); \
00209 } \
00210 _GL_EXTERN_C int _gl_cxxalias_dummy
00211 #else
00212 # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
00213 _GL_EXTERN_C int _gl_cxxalias_dummy
00214 #endif
00215
00216
00217
00218
00219
00220
00221
00222 #if defined __cplusplus && defined GNULIB_NAMESPACE
00223
00224
00225
00226
00227
00228 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
00229 namespace GNULIB_NAMESPACE \
00230 { \
00231 static rettype (*func) parameters = \
00232 reinterpret_cast<rettype(*)parameters>( \
00233 (rettype2(*)parameters2)(::func)); \
00234 } \
00235 _GL_EXTERN_C int _gl_cxxalias_dummy
00236 #else
00237 # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
00238 _GL_EXTERN_C int _gl_cxxalias_dummy
00239 #endif
00240
00241
00242
00243
00244
00245 #if defined __cplusplus && defined GNULIB_NAMESPACE
00246 # define _GL_CXXALIASWARN(func) \
00247 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
00248 # define _GL_CXXALIASWARN_1(func,namespace) \
00249 _GL_CXXALIASWARN_2 (func, namespace)
00250
00251
00252 # if !__OPTIMIZE__
00253 # define _GL_CXXALIASWARN_2(func,namespace) \
00254 _GL_WARN_ON_USE (func, \
00255 "The symbol ::" #func " refers to the system function. " \
00256 "Use " #namespace "::" #func " instead.")
00257 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00258 # define _GL_CXXALIASWARN_2(func,namespace) \
00259 extern __typeof__ (func) func
00260 # else
00261 # define _GL_CXXALIASWARN_2(func,namespace) \
00262 _GL_EXTERN_C int _gl_cxxalias_dummy
00263 # endif
00264 #else
00265 # define _GL_CXXALIASWARN(func) \
00266 _GL_EXTERN_C int _gl_cxxalias_dummy
00267 #endif
00268
00269
00270
00271
00272 #if defined __cplusplus && defined GNULIB_NAMESPACE
00273 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
00274 _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
00275 GNULIB_NAMESPACE)
00276 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
00277 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
00278
00279
00280 # if !__OPTIMIZE__
00281 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00282 _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
00283 "The symbol ::" #func " refers to the system function. " \
00284 "Use " #namespace "::" #func " instead.")
00285 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00286 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00287 extern __typeof__ (func) func
00288 # else
00289 # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
00290 _GL_EXTERN_C int _gl_cxxalias_dummy
00291 # endif
00292 #else
00293 # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
00294 _GL_EXTERN_C int _gl_cxxalias_dummy
00295 #endif
00296
00297 #endif
00298
00299
00300
00301
00302
00303 #ifndef _GL_ARG_NONNULL
00304 # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
00305 # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
00306 # else
00307 # define _GL_ARG_NONNULL(params)
00308 # endif
00309 #endif
00310
00311
00312 #ifndef _GL_WARN_ON_USE
00313
00314 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
00315
00316 # define _GL_WARN_ON_USE(function, message) \
00317 extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
00318 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00319
00320 # define _GL_WARN_ON_USE(function, message) \
00321 extern __typeof__ (function) function
00322 # else
00323 # define _GL_WARN_ON_USE(function, message) \
00324 _GL_WARN_EXTERN_C int _gl_warn_on_use
00325 # endif
00326 #endif
00327
00328
00329
00330
00331
00332
00333
00334 #ifndef _GL_WARN_ON_USE_CXX
00335 # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
00336 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00337 extern rettype function parameters_and_attributes \
00338 __attribute__ ((__warning__ (msg)))
00339 # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
00340
00341 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00342 extern rettype function parameters_and_attributes
00343 # else
00344 # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
00345 _GL_WARN_EXTERN_C int _gl_warn_on_use
00346 # endif
00347 #endif
00348
00349
00350
00351 #ifndef _GL_WARN_EXTERN_C
00352 # if defined __cplusplus
00353 # define _GL_WARN_EXTERN_C extern "C"
00354 # else
00355 # define _GL_WARN_EXTERN_C extern
00356 # endif
00357 #endif
00358
00359
00360
00361 #include <sys/types.h>
00362
00363
00364
00365
00366 #if ! 1
00367 # if !GNULIB_defined_sig_atomic_t
00368 typedef int rpl_sig_atomic_t;
00369 # undef sig_atomic_t
00370 # define sig_atomic_t rpl_sig_atomic_t
00371 # define GNULIB_defined_sig_atomic_t 1
00372 # endif
00373 #endif
00374
00375
00376 #if !1
00377 # if !GNULIB_defined_sigset_t
00378 typedef unsigned int sigset_t;
00379 # define GNULIB_defined_sigset_t 1
00380 # endif
00381 #endif
00382
00383
00384 #if 0
00385 # ifndef SIGPIPE
00386
00387 # define SIGPIPE 13
00388 # define GNULIB_defined_SIGPIPE 1
00389
00390
00391 # endif
00392 #endif
00393
00394
00395
00396 #ifndef NSIG
00397 # if defined __TANDEM
00398 # define NSIG 32
00399 # endif
00400 #endif
00401
00402
00403 #if 1
00404 # if !1
00405
00406
00407 # ifndef NSIG
00408 # define NSIG 32
00409 # endif
00410
00411
00412 # if !GNULIB_defined_verify_NSIG_constraint
00413 typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
00414 # define GNULIB_defined_verify_NSIG_constraint 1
00415 # endif
00416
00417 # endif
00418
00419
00420 # if 1
00421
00422 # if defined __cplusplus && defined GNULIB_NAMESPACE
00423 # undef sigismember
00424 # endif
00425 # else
00426 _GL_FUNCDECL_SYS (sigismember, int, (const sigset_t *set, int sig)
00427 _GL_ARG_NONNULL ((1)));
00428 # endif
00429 _GL_CXXALIAS_SYS (sigismember, int, (const sigset_t *set, int sig));
00430 _GL_CXXALIASWARN (sigismember);
00431
00432
00433 # if 1
00434
00435 # if defined __cplusplus && defined GNULIB_NAMESPACE
00436 # undef sigemptyset
00437 # endif
00438 # else
00439 _GL_FUNCDECL_SYS (sigemptyset, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
00440 # endif
00441 _GL_CXXALIAS_SYS (sigemptyset, int, (sigset_t *set));
00442 _GL_CXXALIASWARN (sigemptyset);
00443
00444
00445 # if 1
00446
00447 # if defined __cplusplus && defined GNULIB_NAMESPACE
00448 # undef sigaddset
00449 # endif
00450 # else
00451 _GL_FUNCDECL_SYS (sigaddset, int, (sigset_t *set, int sig)
00452 _GL_ARG_NONNULL ((1)));
00453 # endif
00454 _GL_CXXALIAS_SYS (sigaddset, int, (sigset_t *set, int sig));
00455 _GL_CXXALIASWARN (sigaddset);
00456
00457
00458 # if 1
00459
00460 # if defined __cplusplus && defined GNULIB_NAMESPACE
00461 # undef sigdelset
00462 # endif
00463 # else
00464 _GL_FUNCDECL_SYS (sigdelset, int, (sigset_t *set, int sig)
00465 _GL_ARG_NONNULL ((1)));
00466 # endif
00467 _GL_CXXALIAS_SYS (sigdelset, int, (sigset_t *set, int sig));
00468 _GL_CXXALIASWARN (sigdelset);
00469
00470
00471 # if 1
00472
00473 # if defined __cplusplus && defined GNULIB_NAMESPACE
00474 # undef sigfillset
00475 # endif
00476 # else
00477 _GL_FUNCDECL_SYS (sigfillset, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
00478 # endif
00479 _GL_CXXALIAS_SYS (sigfillset, int, (sigset_t *set));
00480 _GL_CXXALIASWARN (sigfillset);
00481
00482
00483 # if !1
00484 _GL_FUNCDECL_SYS (sigpending, int, (sigset_t *set) _GL_ARG_NONNULL ((1)));
00485 # endif
00486 _GL_CXXALIAS_SYS (sigpending, int, (sigset_t *set));
00487 _GL_CXXALIASWARN (sigpending);
00488
00489
00490
00491
00492
00493
00494 # if !1
00495 # define SIG_BLOCK 0
00496 # define SIG_SETMASK 1
00497 # define SIG_UNBLOCK 2
00498 _GL_FUNCDECL_SYS (sigprocmask, int,
00499 (int operation, const sigset_t *set, sigset_t *old_set));
00500 # endif
00501 _GL_CXXALIAS_SYS (sigprocmask, int,
00502 (int operation, const sigset_t *set, sigset_t *old_set));
00503 _GL_CXXALIASWARN (sigprocmask);
00504
00505
00506
00507 # ifdef __cplusplus
00508 extern "C" {
00509 # endif
00510 # if !GNULIB_defined_function_taking_int_returning_void_t
00511 typedef void (*_gl_function_taking_int_returning_void_t) (int);
00512 # define GNULIB_defined_function_taking_int_returning_void_t 1
00513 # endif
00514 # ifdef __cplusplus
00515 }
00516 # endif
00517 # if !1
00518 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00519 # define signal rpl_signal
00520 # endif
00521 _GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t,
00522 (int sig, _gl_function_taking_int_returning_void_t func));
00523 _GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t,
00524 (int sig, _gl_function_taking_int_returning_void_t func));
00525 # else
00526 _GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t,
00527 (int sig, _gl_function_taking_int_returning_void_t func));
00528 # endif
00529 _GL_CXXALIASWARN (signal);
00530
00531
00532 # if !1 && GNULIB_defined_SIGPIPE
00533 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00534 # undef raise
00535 # define raise rpl_raise
00536 # endif
00537 _GL_FUNCDECL_RPL (raise, int, (int sig));
00538 _GL_CXXALIAS_RPL (raise, int, (int sig));
00539 # else
00540 _GL_CXXALIAS_SYS (raise, int, (int sig));
00541 # endif
00542 _GL_CXXALIASWARN (raise);
00543
00544 #elif defined GNULIB_POSIXCHECK
00545 # undef sigaddset
00546 # if HAVE_RAW_DECL_SIGADDSET
00547 _GL_WARN_ON_USE (sigaddset, "sigaddset is unportable - "
00548 "use the gnulib module sigprocmask for portability");
00549 # endif
00550 # undef sigdelset
00551 # if HAVE_RAW_DECL_SIGDELSET
00552 _GL_WARN_ON_USE (sigdelset, "sigdelset is unportable - "
00553 "use the gnulib module sigprocmask for portability");
00554 # endif
00555 # undef sigemptyset
00556 # if HAVE_RAW_DECL_SIGEMPTYSET
00557 _GL_WARN_ON_USE (sigemptyset, "sigemptyset is unportable - "
00558 "use the gnulib module sigprocmask for portability");
00559 # endif
00560 # undef sigfillset
00561 # if HAVE_RAW_DECL_SIGFILLSET
00562 _GL_WARN_ON_USE (sigfillset, "sigfillset is unportable - "
00563 "use the gnulib module sigprocmask for portability");
00564 # endif
00565 # undef sigismember
00566 # if HAVE_RAW_DECL_SIGISMEMBER
00567 _GL_WARN_ON_USE (sigismember, "sigismember is unportable - "
00568 "use the gnulib module sigprocmask for portability");
00569 # endif
00570 # undef sigpending
00571 # if HAVE_RAW_DECL_SIGPENDING
00572 _GL_WARN_ON_USE (sigpending, "sigpending is unportable - "
00573 "use the gnulib module sigprocmask for portability");
00574 # endif
00575 # undef sigprocmask
00576 # if HAVE_RAW_DECL_SIGPROCMASK
00577 _GL_WARN_ON_USE (sigprocmask, "sigprocmask is unportable - "
00578 "use the gnulib module sigprocmask for portability");
00579 # endif
00580 #endif
00581
00582
00583 #if 1
00584 # if !1
00585
00586 # if !1
00587
00588 # if !GNULIB_defined_siginfo_types
00589
00590
00591 union sigval
00592 {
00593 int sival_int;
00594 void *sival_ptr;
00595 };
00596
00597
00598 struct siginfo_t
00599 {
00600 int si_signo;
00601 int si_code;
00602 int si_errno;
00603 pid_t si_pid;
00604 uid_t si_uid;
00605 void *si_addr;
00606 int si_status;
00607 long si_band;
00608 union sigval si_value;
00609 };
00610 typedef struct siginfo_t siginfo_t;
00611
00612 # define GNULIB_defined_siginfo_types 1
00613 # endif
00614
00615 # endif
00616
00617
00618
00619
00620 # if !GNULIB_defined_struct_sigaction
00621
00622 struct sigaction
00623 {
00624 union
00625 {
00626 void (*_sa_handler) (int);
00627
00628
00629
00630
00631 void (*_sa_sigaction) (int, siginfo_t *, void *);
00632 } _sa_func;
00633 sigset_t sa_mask;
00634
00635 int sa_flags;
00636 };
00637 # define sa_handler _sa_func._sa_handler
00638 # define sa_sigaction _sa_func._sa_sigaction
00639
00640 # define SA_RESETHAND 1
00641 # define SA_NODEFER 2
00642 # define SA_RESTART 4
00643
00644 # define GNULIB_defined_struct_sigaction 1
00645 # endif
00646
00647 _GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict,
00648 struct sigaction *restrict));
00649
00650 # elif !1
00651
00652 # define sa_sigaction sa_handler
00653
00654 # endif
00655
00656 _GL_CXXALIAS_SYS (sigaction, int, (int, const struct sigaction *restrict,
00657 struct sigaction *restrict));
00658 _GL_CXXALIASWARN (sigaction);
00659
00660 #elif defined GNULIB_POSIXCHECK
00661 # undef sigaction
00662 # if HAVE_RAW_DECL_SIGACTION
00663 _GL_WARN_ON_USE (sigaction, "sigaction is unportable - "
00664 "use the gnulib module sigaction for portability");
00665 # endif
00666 #endif
00667
00668
00669 #ifndef SA_NODEFER
00670 # define SA_NODEFER 0
00671 #endif
00672
00673
00674 #endif
00675 #endif
00676 #endif