Nick Desaulniers e566313a1f
[libc][signal] clean up usage of sighandler_t (#125745)
`man 3 signal`'s declaration has a face _only a mother could love_.

sighandler_t and __sighandler_t are not defined in the C standard, or POSIX.

They are helpful typedefs provided by glibc and the Linux kernel UAPI headers
respectively since working with function pointers' syntax can be painful. But
we should not rely on them; in C++ we have `auto*` and `using` statements.

Remove the proxy header, and only include a typedef for sighandler_t when
targeting Linux, for compatibility with glibc.

Fixes: #125598
2025-02-07 10:43:56 -08:00

29 lines
797 B
C

//===-- Definition of GPU signal number macros ----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIBC_MACROS_GPU_SIGNAL_MACROS_H
#define LLVM_LIBC_MACROS_GPU_SIGNAL_MACROS_H
#define SIGINT 2
#define SIGILL 4
#define SIGABRT 6
#define SIGFPE 8
#define SIGSEGV 11
#define SIGTERM 15
#define SIG_DFL ((void (*)(int))(0))
#define SIG_IGN ((void (*)(int))(1))
#define SIG_ERR ((void (*)(int))(-1))
// Max signal number
#define NSIG 64
#define __NSIGSET_WORDS NSIG
#endif // LLVM_LIBC_MACROS_GPU_SIGNAL_MACROS_H