Index: sandbox/linux/seccomp-bpf/die.h |
diff --git a/sandbox/linux/seccomp-bpf/die.h b/sandbox/linux/seccomp-bpf/die.h |
index f15f10877e9eca0866c67c0198fa8c1d267152f1..7c95997c9c8e05ead7c0952b2dabe5c53a38cb7c 100644 |
--- a/sandbox/linux/seccomp-bpf/die.h |
+++ b/sandbox/linux/seccomp-bpf/die.h |
@@ -13,9 +13,13 @@ namespace playground2 { |
class Die { |
public: |
// This is the main API for using this file. Prints a error message and |
- // exits with a fatal error. |
+ // exits with a fatal error. This is not async-signal safe. |
#define SANDBOX_DIE(m) playground2::Die::SandboxDie(m, __FILE__, __LINE__) |
+ // An async signal safe version of the same API. Won't print the filename |
+ // and line numbers. |
+ #define RAW_SANDBOX_DIE(m) playground2::Die::RawSandboxDie(m) |
+ |
// Adds an informational message to the log file or stderr as appropriate. |
#define SANDBOX_INFO(m) playground2::Die::SandboxInfo(m, __FILE__, __LINE__) |
@@ -31,6 +35,8 @@ class Die { |
static void SandboxDie(const char *msg, const char *file, int line) |
__attribute__((noreturn)); |
+ static void RawSandboxDie(const char *msg) __attribute__((noreturn)); |
+ |
// This method gets called by SANDBOX_INFO(). There is normally no reason |
// to call it directly unless you are defining your own logging macro. |
static void SandboxInfo(const char *msg, const char *file, int line); |