Path: blob/main/contrib/llvm-project/libc/include/llvm-libc-macros/linux/signal-macros.h
213799 views
//===-- Definition of Linux signal number macros --------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_LIBC_MACROS_LINUX_SIGNAL_MACROS_H9#define LLVM_LIBC_MACROS_LINUX_SIGNAL_MACROS_H1011#define SIGHUP 112#define SIGINT 213#define SIGQUIT 314#define SIGILL 415#define SIGTRAP 516#define SIGABRT 617#define SIGIOT 618#define SIGBUS 719#define SIGFPE 820#define SIGKILL 921#define SIGUSR1 1022#define SIGSEGV 1123#define SIGUSR2 1224#define SIGPIPE 1325#define SIGALRM 1426#define SIGTERM 1527#define SIGSTKFLT 1628#define SIGCHLD 1729#define SIGCONT 1830#define SIGSTOP 1931#define SIGTSTP 2032#define SIGTTIN 2133#define SIGTTOU 2234#define SIGURG 2335#define SIGXCPU 2436#define SIGXFSZ 2537#define SIGVTALRM 2638#define SIGPROF 2739#define SIGWINCH 2840#define SIGIO 2941#define SIGPOLL SIGIO42#define SIGPWR 3043#define SIGSYS 314445// Max signal number46#define NSIG 644748// SIGRTMIN is current set to the minimum usable from user mode programs. If49// the libc itself uses some of these signal numbers for private operations,50// then it has to be adjusted in future to reflect that.51#define SIGRTMIN 325253#define SIGRTMAX NSIG5455// The kernel sigset is stored as an array of long values. Each bit of this56// array corresponds to a signal, adjusted by 1. That is, bit 0 corresponds57// to signal number 1, bit 1 corresponds to signal number 2 and so on. The58// below macro denotes the size of that array (in number of long words and59// not bytes).60#define __NSIGSET_WORDS (NSIG / (sizeof(unsigned long) * 8))6162#define SIG_BLOCK 0 // For blocking signals63#define SIG_UNBLOCK 1 // For unblocking signals64#define SIG_SETMASK 2 // For setting signal mask6566// Flag values to be used for setting sigaction.sa_flags.67#define SA_NOCLDSTOP 0x0000000168#define SA_NOCLDWAIT 0x0000000269#define SA_SIGINFO 0x0000000470#define SA_RESTART 0x1000000071#define SA_RESTORER 0x0400000072#define SA_ONSTACK 0x080000007374// Signal stack flags75#define SS_ONSTACK 0x176#define SS_DISABLE 0x27778#if defined(__x86_64__) || defined(__i386__) || defined(__riscv)79#define MINSIGSTKSZ 204880#define SIGSTKSZ 819281#elif defined(__aarch64__)82#define MINSIGSTKSZ 512083#define SIGSTKSZ 1638484#else85#error "Signal stack sizes not defined for your platform."86#endif8788#define SIG_DFL ((void (*)(int))0)89#define SIG_IGN ((void (*)(int))1)90#define SIG_ERR ((void (*)(int))(-1))9192// SIGCHLD si_codes93#define CLD_EXITED 1 // child has exited94#define CLD_KILLED 2 // child was killed95#define CLD_DUMPED 3 // child terminated abnormally96#define CLD_TRAPPED 4 // traced child has trapped97#define CLD_STOPPED 5 // child has stopped98#define CLD_CONTINUED 6 // stopped child has continued99100#endif // LLVM_LIBC_MACROS_LINUX_SIGNAL_MACROS_H101102103