| // |
| // Copyright © 2005-2020 Rich Felker, et al. |
| // Licensed under the MIT license.s |
| // |
| |
| /* Copyright © 2005-2020 Rich Felker, et al. |
| |
| Permission is hereby granted, free of charge, to any person obtaining |
| a copy of this software and associated documentation files (the |
| "Software"), to deal in the Software without restriction, including |
| without limitation the rights to use, copy, modify, merge, publish, |
| distribute, sublicense, and/or sell copies of the Software, and to |
| permit persons to whom the Software is furnished to do so, subject to |
| the following conditions: |
| |
| The above copyright notice and this permission notice shall be |
| included in all copies or substantial portions of the Software. |
| |
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ |
| |
| #ifndef _SIGNAL_H |
| #define _SIGNAL_H |
| |
| #include <sys/_types.h> |
| |
| typedef struct { |
| unsigned long _bits[128/sizeof(long)]; |
| } __sigset_t; |
| |
| typedef __sigset_t sigset_t; |
| |
| union sigval { |
| int sival_int; |
| void *sival_ptr; |
| }; |
| |
| typedef struct { |
| int si_signo; |
| int si_errno; |
| int si_code; |
| union { |
| char __pad[128 - 2*sizeof(int) - sizeof(long)]; |
| struct { |
| union { |
| struct { |
| __pid_t si_pid; |
| __uid_t si_uid; |
| } __piduid; |
| struct { |
| int si_timerid; |
| int si_overrun; |
| } __timer; |
| } __first; |
| union { |
| union sigval si_value; |
| struct { |
| int si_status; |
| __clock_t si_utime, si_stime; |
| } __sigchld; |
| } __second; |
| } __si_common; |
| struct { |
| void *si_addr; |
| short si_addr_lsb; |
| union { |
| struct { |
| void *si_lower; |
| void *si_upper; |
| } __addr_bnd; |
| unsigned si_pkey; |
| } __first; |
| } __sigfault; |
| struct { |
| long si_band; |
| int si_fd; |
| } __sigpoll; |
| struct { |
| void *si_call_addr; |
| int si_syscall; |
| unsigned si_arch; |
| } __sigsys; |
| } __si_fields; |
| } siginfo_t; |
| |
| struct sigaction { |
| union { |
| void (*sa_handler) (int); |
| void (*sa_sigaction) (int, siginfo_t *, void *); |
| } __sa_handler; |
| __sigset_t sa_mask; |
| int sa_flags; |
| void (*sa_restorer) (void); |
| }; |
| |
| #define sa_handler __sa_handler.sa_handler |
| #define sa_sigaction __sa_handler.sa_sigaction |
| |
| #endif |