LibDap
This library contains the basic modules that are used in the products of the family DAP
dap_process_manager.h
Go to the documentation of this file.
1 #ifdef __linux__
2 
3 #include <stdbool.h>
4 #include <unistd.h>
5 
6 /* Saves process pid into file by file_path.
7  * If file exists he will be overwritten */
8 extern bool save_process_pid_in_file(const char* file_path);
9 
10 /* File must consist only PID. Return 0 if file is clear. */
11 extern pid_t get_pid_from_file(const char* file_path);
12 
13 /* Return true if process running */
14 extern bool is_process_running(pid_t pid);
15 
16 /* Demonizes current process and exit from program */
17 extern bool daemonize_process(void);
18 
19 /* Sends SIGKILL to process */
20 extern bool kill_process(pid_t pid);
21 
22 #endif
bool daemonize_process()
daemonize_process Demonizes current process and exit from program
Definition: dap_process_manager.c:63
bool save_process_pid_in_file(const char *file_path)
save_process_pid_in_file Saves process pid into file by file_path
Definition: dap_process_manager.c:29
pid_t get_pid_from_file(const char *file_path)
get_pid_from_file File must consist only PID. Return 0 if file is clear.
Definition: dap_process_manager.c:45
bool is_process_running(pid_t pid)
is_process_running Check whether the process is running
Definition: dap_process_manager.c:17
bool kill_process(pid_t pid)
kill_process Sends SIGKILL to process
Definition: dap_process_manager.c:72