1// Copyright 2018 the V8 project 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 V8_TRAP_HANDLER_HANDLER_INSIDE_POSIX_H_
6#define V8_TRAP_HANDLER_HANDLER_INSIDE_POSIX_H_
7
8#include <signal.h>
9#include "include/v8config.h"
10
11namespace v8 {
12namespace internal {
13namespace trap_handler {
14
15#if V8_OS_LINUX
16constexpr int kOobSignal = SIGSEGV;
17#elif V8_OS_MACOSX
18constexpr int kOobSignal = SIGBUS;
19#else
20#error Posix trap handlers are only supported on Linux and MacOSX.
21#endif
22
23void HandleSignal(int signum, siginfo_t* info, void* context);
24
25bool TryHandleSignal(int signum, siginfo_t* info, void* context);
26
27} // namespace trap_handler
28} // namespace internal
29} // namespace v8
30
31#endif // V8_TRAP_HANDLER_HANDLER_INSIDE_POSIX_H_
32