2011-09-02 18:23:13 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
2023-04-09 21:53:59 +00:00
|
|
|
// Copyright (C) 2023 University of California
|
2011-09-02 18:23:13 +00:00
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC 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 Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2023-04-11 20:11:12 +00:00
|
|
|
// functions for building the system-wide process tree,
|
|
|
|
// and querying/controlling it
|
2023-04-09 21:53:59 +00:00
|
|
|
|
2017-04-08 06:54:49 +00:00
|
|
|
#ifndef BOINC_PROC_CONTROL_H
|
|
|
|
#define BOINC_PROC_CONTROL_H
|
2011-09-02 18:23:13 +00:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2023-04-09 21:53:59 +00:00
|
|
|
#ifdef _WIN32
|
2023-04-11 20:11:12 +00:00
|
|
|
#include <windows.h>
|
2023-04-09 21:53:59 +00:00
|
|
|
#endif
|
|
|
|
|
2011-09-02 18:23:13 +00:00
|
|
|
extern void get_descendants(int pid, std::vector<int>& pids);
|
|
|
|
extern bool any_process_exists(std::vector<int>& pids);
|
|
|
|
extern void kill_all(std::vector<int>& pids);
|
|
|
|
#ifdef _WIN32
|
|
|
|
extern void kill_descendants();
|
2012-12-12 00:05:40 +00:00
|
|
|
extern int suspend_or_resume_threads(
|
|
|
|
std::vector<int> pids, DWORD threadid, bool resume, bool check_exempt
|
|
|
|
);
|
2024-01-08 21:34:22 +00:00
|
|
|
extern void suspend_or_resume_descendants(bool resume);
|
|
|
|
extern void suspend_or_resume_process(int pid, bool resume);
|
2011-09-02 18:23:13 +00:00
|
|
|
#else
|
|
|
|
extern void kill_descendants(int child_pid=0);
|
2024-01-08 21:34:22 +00:00
|
|
|
extern void suspend_or_resume_descendants(bool resume, bool use_tstp=false);
|
|
|
|
extern void suspend_or_resume_process(int pid, bool resume, bool use_tstp=false);
|
2011-09-02 18:23:13 +00:00
|
|
|
#endif
|
|
|
|
|
2014-10-13 18:35:16 +00:00
|
|
|
extern int process_priority_value(int);
|
|
|
|
|
2011-09-02 18:23:13 +00:00
|
|
|
#endif
|