forked from gary/ems
2
0
Fork 0
sun_ems/ems_c/daemon.h

34 lines
1.2 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*****************************************************************************
* @copyright 2024-2024, . POWER SUPPLY CO., LTD.
* @file daemon.c
* @brief 进程守护
* @author Gary
* @date 2024/09/20
* @remark
*****************************************************************************/
#ifndef DAEMON_H
#define DAEMON_H
#define DAEMON_LOCK_FNAME "/tmp/company-ems.pid"
/*****************************************************************************
* @brief 守护进程启动函数
* @return
*****************************************************************************/
void daemonize();
/*****************************************************************************
* @brief 检查守护进程是否已运行
* @return 0-没有运行进行上锁1-正在运行
*****************************************************************************/
int checkDaemonRunning();
/*****************************************************************************
* @brief 停止守护进程
* @return 0-成功1-失败
*****************************************************************************/
int stop_daemon();
#endif