brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.1 KiB · e7f268d Raw
105 lines · c
1//===-- Definition of Linux signal number macros --------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_LIBC_MACROS_LINUX_SIGNAL_MACROS_H10#define LLVM_LIBC_MACROS_LINUX_SIGNAL_MACROS_H11 12#include "__llvm-libc-common.h"13 14#define SIGHUP 115#define SIGINT 216#define SIGQUIT 317#define SIGILL 418#define SIGTRAP 519#define SIGABRT 620#define SIGIOT 621#define SIGBUS 722#define SIGFPE 823#define SIGKILL 924#define SIGUSR1 1025#define SIGSEGV 1126#define SIGUSR2 1227#define SIGPIPE 1328#define SIGALRM 1429#define SIGTERM 1530#define SIGSTKFLT 1631#define SIGCHLD 1732#define SIGCONT 1833#define SIGSTOP 1934#define SIGTSTP 2035#define SIGTTIN 2136#define SIGTTOU 2237#define SIGURG 2338#define SIGXCPU 2439#define SIGXFSZ 2540#define SIGVTALRM 2641#define SIGPROF 2742#define SIGWINCH 2843#define SIGIO 2944#define SIGPOLL SIGIO45#define SIGPWR 3046#define SIGSYS 3147 48// Max signal number49#define NSIG 6450 51// SIGRTMIN is current set to the minimum usable from user mode programs. If52// the libc itself uses some of these signal numbers for private operations,53// then it has to be adjusted in future to reflect that.54#define SIGRTMIN 3255 56#define SIGRTMAX NSIG57 58// The kernel sigset is stored as an array of long values. Each bit of this59// array corresponds to a signal, adjusted by 1. That is, bit 0 corresponds60// to signal number 1, bit 1 corresponds to signal number 2 and so on. The61// below macro denotes the size of that array (in number of long words and62// not bytes).63#define __NSIGSET_WORDS (NSIG / (sizeof(unsigned long) * 8))64 65#define SIG_BLOCK 0   // For blocking signals66#define SIG_UNBLOCK 1 // For unblocking signals67#define SIG_SETMASK 2 // For setting signal mask68 69// Flag values to be used for setting sigaction.sa_flags.70#define SA_NOCLDSTOP 0x0000000171#define SA_NOCLDWAIT 0x0000000272#define SA_SIGINFO 0x0000000473#define SA_RESTART 0x1000000074#define SA_RESTORER 0x0400000075#define SA_ONSTACK 0x0800000076 77// Signal stack flags78#define SS_ONSTACK 0x179#define SS_DISABLE 0x280 81#if defined(__x86_64__) || defined(__i386__) || defined(__riscv)82#define MINSIGSTKSZ 204883#define SIGSTKSZ 819284#elif defined(__aarch64__)85#define MINSIGSTKSZ 512086#define SIGSTKSZ 1638487#else88#error "Signal stack sizes not defined for your platform."89#endif90 91#define SIG_ERR __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), -1)92#define SIG_DFL __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 0)93#define SIG_IGN __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 1)94#define SIG_HOLD __LLVM_LIBC_CAST(reinterpret_cast, void (*)(int), 2)95 96// SIGCHLD si_codes97#define CLD_EXITED 1    // child has exited98#define CLD_KILLED 2    // child was killed99#define CLD_DUMPED 3    // child terminated abnormally100#define CLD_TRAPPED 4   // traced child has trapped101#define CLD_STOPPED 5   // child has stopped102#define CLD_CONTINUED 6 // stopped child has continued103 104#endif // LLVM_LIBC_MACROS_LINUX_SIGNAL_MACROS_H105