LibDap
This library contains the basic modules that are used in the products of the family DAP
Macros | Functions
dap_process_manager.c File Reference
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
#include "dap_process_manager.h"
#include "../dap_common.h"

Macros

#define LOG_TAG   "dap_process_manager"
 

Functions

bool is_process_running (pid_t pid)
 is_process_running Check whether the process is running More...
 
bool save_process_pid_in_file (const char *file_path)
 save_process_pid_in_file Saves process pid into file by file_path More...
 
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. More...
 
bool daemonize_process ()
 daemonize_process Demonizes current process and exit from program More...
 
bool kill_process (pid_t pid)
 kill_process Sends SIGKILL to process More...
 

Macro Definition Documentation

#define LOG_TAG   "dap_process_manager"

Function Documentation

bool daemonize_process ( )

daemonize_process Demonizes current process and exit from program

Returns
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.

Parameters
[in]file_pathFile path
Returns
Execution result
bool is_process_running ( pid_t  pid)

is_process_running Check whether the process is running

Parameters
[in]pidPID
Returns
bool kill_process ( pid_t  pid)

kill_process Sends SIGKILL to process

Parameters
[in]pid
Returns
bool save_process_pid_in_file ( const char *  file_path)

save_process_pid_in_file Saves process pid into file by file_path

Parameters
[in]file_pathFile path
Returns
Execution result

Saves process pid into file by file_path. If file exists he will be overwritten