1 /* 2 * ParentProcessMonitor.hpp 3 * 4 * Copyright (C) 2021 by RStudio, PBC 5 * 6 * Unless you have received this program directly from RStudio pursuant 7 * to the terms of a commercial license agreement with RStudio, then 8 * this program is licensed to you under the terms of version 3 of the 9 * GNU Affero General Public License. This program is distributed WITHOUT 10 * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, 11 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the 12 * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details. 13 * 14 */ 15 16 #ifndef PARENT_PROCESS_MONITOR_HPP 17 #define PARENT_PROCESS_MONITOR_HPP 18 19 #include <shared_core/Error.hpp> 20 #include <boost/function.hpp> 21 22 namespace rstudio { 23 namespace core { 24 namespace parent_process_monitor { 25 26 Error wrapFork(boost::function<void()> func); 27 28 enum ParentTermination { 29 ParentTerminationNormal, 30 ParentTerminationAbnormal, 31 ParentTerminationNoParent, 32 ParentTerminationWaitFailure 33 }; 34 35 ParentTermination waitForParentTermination(); 36 37 } // namespace parent_process_monitor 38 } // namespace core 39 } // namespace rstudio 40 41 #endif // PARENT_PROCESS_MONITOR_HPP 42