Back to index

glibc  2.9
sigaction.h
Go to the documentation of this file.
00001 /* Definitions for 31 & 64 bit S/390 sigaction.
00002    Copyright (C) 2001, 2002 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef _SIGNAL_H
00021 # error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
00022 #endif
00023 
00024 #include <bits/wordsize.h>
00025 
00026 #if __WORDSIZE == 64
00027 /* Structure describing the action to be taken when a signal arrives.  */
00028 struct sigaction
00029   {
00030     /* Signal handler.      */
00031 #ifdef __USE_POSIX199309
00032     union
00033       {
00034        /* Used if SA_SIGINFO is not set.  */
00035        __sighandler_t sa_handler;
00036        /* Used if SA_SIGINFO is set.  */
00037        void (*sa_sigaction) (int, siginfo_t *, void *);
00038       }
00039     __sigaction_handler;
00040 # define sa_handler  __sigaction_handler.sa_handler
00041 # define sa_sigaction       __sigaction_handler.sa_sigaction
00042 #else
00043     __sighandler_t sa_handler;
00044 #endif
00045 
00046     /* Special flags.  */
00047     unsigned long int sa_flags;
00048 
00049     /* Restore handler.  */
00050     void (*sa_restorer) (void);
00051 
00052     /* Additional set of signals to be blocked.   */
00053     __sigset_t sa_mask;
00054   };
00055 #else
00056 /* Structure describing the action to be taken when a signal arrives.  */
00057 struct sigaction
00058   {
00059     /* Signal handler.  */
00060 #ifdef __USE_POSIX199309
00061     union
00062       {
00063        /* Used if SA_SIGINFO is not set.  */
00064        __sighandler_t sa_handler;
00065        /* Used if SA_SIGINFO is set.  */
00066        void (*sa_sigaction) (int, siginfo_t *, void *);
00067       }
00068     __sigaction_handler;
00069 # define sa_handler  __sigaction_handler.sa_handler
00070 # define sa_sigaction       __sigaction_handler.sa_sigaction
00071 #else
00072     __sighandler_t sa_handler;
00073 #endif
00074 
00075     /* Additional set of signals to be blocked.  */
00076     __sigset_t sa_mask;
00077 
00078     /* Special flags.  */
00079     int sa_flags;
00080 
00081     /* Restore handler.  */
00082     void (*sa_restorer) (void);
00083   };
00084 #endif
00085 
00086 /* Bits in `sa_flags'.  */
00087 #define       SA_NOCLDSTOP  1              /* Don't send SIGCHLD when children stop.  */
00088 #define SA_NOCLDWAIT  2             /* Don't create zombie on child death.  */
00089 #define SA_SIGINFO    4             /* Invoke signal-catching function with
00090                                 three arguments instead of one.  */
00091 #if defined __USE_UNIX98 || defined __USE_MISC
00092 # define SA_ONSTACK   0x08000000 /* Use signal stack by using `sa_restorer'. */
00093 # define SA_RESTART   0x10000000 /* Restart syscall on signal return.  */
00094 # define SA_NODEFER   0x40000000 /* Don't automatically block the signal when
00095                                 its handler is being executed.  */
00096 # define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler.  */
00097 #endif
00098 #ifdef __USE_MISC
00099 # define SA_INTERRUPT 0x20000000 /* Historical no-op.  */
00100 
00101 /* Some aliases for the SA_ constants.    */
00102 # define SA_NOMASK    SA_NODEFER
00103 # define SA_ONESHOT   SA_RESETHAND
00104 # define SA_STACK     SA_ONSTACK
00105 #endif
00106 
00107 /* Values for the HOW argument to `sigprocmask'.  */
00108 #define       SIG_BLOCK     0              /* Block signals.  */
00109 #define       SIG_UNBLOCK   1              /* Unblock signals.  */
00110 #define       SIG_SETMASK   2              /* Set the set of blocked signals.  */