no message

master
zcy 2021-08-13 00:29:17 +08:00
parent b6f0846fbf
commit bb2bffc10a
2 changed files with 649 additions and 148 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,40 +1,99 @@
/* /*
* @Author: your name * @Author: your name
* @Date: 2021-07-23 23:40:36 * @Date: 2021-07-23 23:40:36
* @LastEditTime: 2021-08-01 13:17:35
* @LastEditTime: 2021-08-13 00:28:16
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edi * @Description: In User Settings Edi
* @FilePath: \generallib\general\src\function\daemon.h * @FilePath: \generallib\general\src\function\daemon.h
*/ */
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
#pragma message("编译器支持c++11") #pragma message("编译器支持c++11")
#endif #endif
#ifdef linux
#include <unistd.h>
#endif
#include <list> #include <list>
#include<iostream> #include<iostream>
#include <algorithm> #include <algorithm>
using namespace std; using namespace std;
extern "C"{
#include<stdio.h>
#include <time.h>
}
#ifdef WIN32
#include <windows.h> #include <windows.h>
#include <Tlhelp32.h> #include <Tlhelp32.h>
#include <psapi.h> #include <psapi.h>
#endif
#include <string> #include <string>
#include <vector> #include <vector>
#include <map> #include <map>
#include <stdint.h> #include <stdint.h>
#include <thread> #include <thread>
#include <stdio.h>
#include <errno.h>
#include <memory.h>
class DaemonizeMonitor{ class DaemonizeMonitor{
public: public:
DaemonizeMonitor(string path); DaemonizeMonitor(string path);
int AddNewProcess(string); int AddNewProcess(string);
int StopMonitor(string); int StopMonitor(string);
int StopProcess(string); int StopProcess(string);
int StartMonitor(); int StartMonitor();
private: private:
std::vector<string> m_path_process; std::vector<string> m_path_process;
std::map<string,uint32_t> m_running_pid; std::map<string,uint32_t> m_running_pid;
}; };