  uintptr_t _EINIT(secs_t* secs, enclave_css_t *css, token_t *launch)
  {
      CEnclaveMngr *mngr = CEnclaveMngr::get_instance();
-@@ -129,6 +248,8 @@
+@@ -129,6 +249,8 @@
          }
      }
  

 #include <stdio.h>
 #include <stdlib.h>
 
@@ -71,6 +78,118 @@
 
 #define mcp_same_size(dst_ptr, src_ptr, size) memcpy_s(dst_ptr, size, src_ptr, size)
 

+    // Invoke the registered signal handler.
+    {
+        std::lock_guard<std::mutex> lock(registered_signal_handlers_lock);
+        const auto it = registered_signal_handlers.find(signum);
+        if (it != registered_signal_handlers.end())
+        {
+            struct sigaction *act = it->second.get();
+            if ((!(act->sa_flags & SA_SIGINFO)) && act->sa_handler)
+            {
+                act->sa_handler(signum);
