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
* @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
* @Description: In User Settings Edi
* @FilePath: \generallib\general\src\function\daemon.h
*/
#if __cplusplus >= 201103L
#pragma message("编译器支持c++11")
#endif
#ifdef linux
#include <unistd.h>
#endif
#include <list>
#include<iostream>
#include <algorithm>
using namespace std;
extern "C"{
#include<stdio.h>
#include <time.h>
}
#ifdef WIN32
#include <windows.h>
#include <Tlhelp32.h>
#include <psapi.h>
#endif
#include <string>
#include <vector>
#include <map>
#include <stdint.h>
#include <thread>
#include <stdio.h>
#include <errno.h>
#include <memory.h>
class DaemonizeMonitor{
public:
DaemonizeMonitor(string path);
int AddNewProcess(string);
int StopMonitor(string);
int StopProcess(string);
int StartMonitor();
private:
std::vector<string> m_path_process;
std::map<string,uint32_t> m_running_pid;
};