diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f92f88cc4..eb5bd53ec 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -182,6 +182,7 @@ include_directories(AFTER
${CMAKE_CURRENT_SOURCE_DIR}/Accelerate/include
${CMAKE_CURRENT_SOURCE_DIR}/IOSurface/include
${CMAKE_CURRENT_SOURCE_DIR}/external/cocotron/OpenGL/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/libquit/include
)
# It must be done in this scope
@@ -355,6 +356,7 @@ add_subdirectory(CoreVideo)
add_subdirectory(Accelerate)
add_subdirectory(IOSurface)
add_subdirectory(external/cocotron/OpenGL)
+add_subdirectory(libquit)
# /Applications
#add_subdirectory(external/TextEdit)
diff --git a/src/libquit/CMakeLists.txt b/src/libquit/CMakeLists.txt
new file mode 100755
index 000000000..534371494
--- /dev/null
+++ b/src/libquit/CMakeLists.txt
@@ -0,0 +1,12 @@
+project(quit)
+
+set(DYLIB_INSTALL_NAME "/usr/lib/libquit.dylib")
+set(DYLIB_COMPAT_VERSION "1.0.0")
+set(DYLIB_CURRENT_VERSION "1.0.0")
+
+add_darling_library(quit SHARED
+ src/quit.c
+)
+make_fat(quit)
+target_link_libraries(quit system)
+install(TARGETS quit DESTINATION libexec/darling/usr/lib)
diff --git a/src/libquit/include/quit/quit.h b/src/libquit/include/quit/quit.h
new file mode 100755
index 000000000..4294c75eb
--- /dev/null
+++ b/src/libquit/include/quit/quit.h
@@ -0,0 +1,41 @@
+/*
+ This file is part of Darling.
+
+ Copyright (C) 2017 Lubos Dolezel
+
+ Darling is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Darling is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Darling. If not, see .
+*/
+
+
+#ifndef _quit_H_
+#define _quit_H_
+
+void* LQCachePort(void);
+void* LQForceQuit(void);
+void* LQNotifyCpuResource(void);
+void* LQNotifyFacelessQuitHappening(void);
+void* LQNotifyQuitLikely(void);
+void* LQNotifySpinLikely(void);
+void* LQNotifyStuckApp(void);
+void* LQNotifyUiQuitHappening(void);
+void* LQNotifyUnstuckApp(void);
+void* LQNotifyWakeupsResource(void);
+void* LQReportCpuResource(void);
+void* LQReportPotentialHang(void);
+void* LQReportPotentialSpin(void);
+void* LQReportStuckApp(void);
+void* LQReportUnstuckApp(void);
+void* LQReportWakeupsResource(void);
+
+#endif
diff --git a/src/libquit/src/quit.c b/src/libquit/src/quit.c
new file mode 100755
index 000000000..4a2edc3c4
--- /dev/null
+++ b/src/libquit/src/quit.c
@@ -0,0 +1,110 @@
+/*
+ This file is part of Darling.
+
+ Copyright (C) 2017 Lubos Dolezel
+
+ Darling is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Darling is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Darling. If not, see .
+*/
+
+
+#include
+#include
+#include
+
+static int verbose = 0;
+
+__attribute__((constructor))
+static void initme(void) {
+ verbose = getenv("STUB_VERBOSE") != NULL;
+}
+
+void* LQCachePort(void) {
+ if (verbose) puts("STUB: LQCachePort called");
+ return NULL;
+}
+
+void* LQForceQuit(void) {
+ if (verbose) puts("STUB: LQForceQuit called");
+ return NULL;
+}
+
+void* LQNotifyCpuResource(void) {
+ if (verbose) puts("STUB: LQNotifyCpuResource called");
+ return NULL;
+}
+
+void* LQNotifyFacelessQuitHappening(void) {
+ if (verbose) puts("STUB: LQNotifyFacelessQuitHappening called");
+ return NULL;
+}
+
+void* LQNotifyQuitLikely(void) {
+ if (verbose) puts("STUB: LQNotifyQuitLikely called");
+ return NULL;
+}
+
+void* LQNotifySpinLikely(void) {
+ if (verbose) puts("STUB: LQNotifySpinLikely called");
+ return NULL;
+}
+
+void* LQNotifyStuckApp(void) {
+ if (verbose) puts("STUB: LQNotifyStuckApp called");
+ return NULL;
+}
+
+void* LQNotifyUiQuitHappening(void) {
+ if (verbose) puts("STUB: LQNotifyUiQuitHappening called");
+ return NULL;
+}
+
+void* LQNotifyUnstuckApp(void) {
+ if (verbose) puts("STUB: LQNotifyUnstuckApp called");
+ return NULL;
+}
+
+void* LQNotifyWakeupsResource(void) {
+ if (verbose) puts("STUB: LQNotifyWakeupsResource called");
+ return NULL;
+}
+
+void* LQReportCpuResource(void) {
+ if (verbose) puts("STUB: LQReportCpuResource called");
+ return NULL;
+}
+
+void* LQReportPotentialHang(void) {
+ if (verbose) puts("STUB: LQReportPotentialHang called");
+ return NULL;
+}
+
+void* LQReportPotentialSpin(void) {
+ if (verbose) puts("STUB: LQReportPotentialSpin called");
+ return NULL;
+}
+
+void* LQReportStuckApp(void) {
+ if (verbose) puts("STUB: LQReportStuckApp called");
+ return NULL;
+}
+
+void* LQReportUnstuckApp(void) {
+ if (verbose) puts("STUB: LQReportUnstuckApp called");
+ return NULL;
+}
+
+void* LQReportWakeupsResource(void) {
+ if (verbose) puts("STUB: LQReportWakeupsResource called");
+ return NULL;
+}