OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SIGNAL_H_ |
| 6 #define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SIGNAL_H_ |
| 7 |
| 8 // NOTE: On some toolchains, signal related ABI is incompatible with Linux's. |
| 9 // So, here we declare necessary macros, structs and functions in Linux ABI. |
| 10 |
| 11 #include <stdint.h> |
| 12 |
| 13 #define LINUX_SIGBUS 7 |
| 14 #define LINUX_SIGSYS 31 |
| 15 |
| 16 #define LINUX_SIG_BLOCK 0 |
| 17 #define LINUX_SIG_UNBLOCK 1 |
| 18 |
| 19 #define LINUX_SA_SIGINFO 4 |
| 20 #define LINUX_SA_NODEFER 0x40000000 |
| 21 |
| 22 #define LINUX_SIG_DFL 0 |
| 23 |
| 24 struct arch_sigsys { |
| 25 void* ip; |
| 26 int nr; |
| 27 unsigned int arch; |
| 28 }; |
| 29 |
| 30 typedef struct { |
| 31 int si_signo; |
| 32 int si_errno; |
| 33 int si_code; |
| 34 struct { |
| 35 struct arch_sigsys _sigsys; |
| 36 } _sifields; |
| 37 } linux_siginfo_t; |
| 38 |
| 39 // Linux sigset_t is 64 bits. |
| 40 typedef struct { |
| 41 uint32_t sig[2]; |
| 42 } linux_sigset_t; |
| 43 |
| 44 struct linux_sigaction { |
| 45 // Traling '_' is to avoid name confliction defined by some toolchains. |
| 46 union { |
| 47 void (*sa_handler_)(int); |
| 48 void (*sa_sigaction_)(int, linux_siginfo_t*, void*); |
| 49 }; |
| 50 uint32_t sa_flags; |
| 51 void (*sa_restorer)(void); |
| 52 linux_sigset_t sa_mask; |
| 53 }; |
| 54 |
| 55 #endif |
OLD | NEW |