/*
- * Copyright 2013 Facebook, Inc.
+ * Copyright 2013-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*/
-#ifndef FOLLY_SYMBOLIZER_SIGNALHANDLER_H_
-#define FOLLY_SYMBOLIZER_SIGNALHANDLER_H_
+#pragma once
#include <functional>
-namespace folly { namespace symbolizer {
+namespace folly {
+namespace symbolizer {
/**
* Install handler for fatal signals. The list of signals being handled is in
*/
void installFatalSignalHandler();
-
/**
* Add a callback to be run when receiving a fatal signal. They will also
* be called by LOG(FATAL) and abort() (as those raise SIGABRT internally).
* LOG(...) or printf or malloc / new or doing anything even remotely fun.
*
* All these fatal callback must be added before calling
- * installFatalSignalHandler().
+ * installFatalSignalCallbacks(), below.
*/
-void addFatalSignalCallback(std::function<void()> callback);
-
-
-}} // namespaces
-
-#endif /* FOLLY_SYMBOLIZER_SIGNALHANDLER_H_ */
+typedef void (*SignalCallback)();
+void addFatalSignalCallback(SignalCallback callback);
+/**
+ * Install the fatal signal callbacks; fatal signals will call these
+ * callbacks in the order in which they were added.
+ */
+void installFatalSignalCallbacks();
+} // namespace symbolizer
+} // namespace folly