1 // This file is part of BOINC. 2 // http://boinc.berkeley.edu 3 // Copyright (C) 2011 University of California 4 // 5 // BOINC is free software; you can redistribute it and/or modify it 6 // under the terms of the GNU Lesser General Public License 7 // as published by the Free Software Foundation, 8 // either version 3 of the License, or (at your option) any later version. 9 // 10 // BOINC is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 // See the GNU Lesser General Public License for more details. 14 // 15 // You should have received a copy of the GNU Lesser General Public License 16 // along with BOINC. If not, see <http://www.gnu.org/licenses/>. 17 18 #ifndef BOINC_PROC_CONTROL_H 19 #define BOINC_PROC_CONTROL_H 20 21 #include <vector> 22 #ifdef _WIN32 23 #include <windows.h> 24 #endif 25 26 extern void get_descendants(int pid, std::vector<int>& pids); 27 extern bool any_process_exists(std::vector<int>& pids); 28 extern void kill_all(std::vector<int>& pids); 29 #ifdef _WIN32 30 extern void kill_descendants(); 31 extern int suspend_or_resume_threads( 32 std::vector<int> pids, DWORD threadid, bool resume, bool check_exempt 33 ); 34 #else 35 extern void kill_descendants(int child_pid=0); 36 #endif 37 extern void suspend_or_resume_descendants(bool resume); 38 extern void suspend_or_resume_process(int pid, bool resume); 39 40 extern int process_priority_value(int); 41 42 #endif 43