#ifndef ZABBIX_ZBXNIX_H
#define ZABBIX_ZBXNIX_H
#include "zbxsysinc.h"
#include "zbxtypes.h"
#include "zbxmutexs.h"
#if defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
int zbx_coredump_disable(void);
#endif
#if defined(_WINDOWS)
# error "This module allowed only for Unix OS"
#endif
typedef void (*zbx_on_exit_t)(int);
void zbx_set_exiting_with_fail(void);
void zbx_set_exiting_with_succeed(void);
int ZBX_IS_RUNNING(void);
int ZBX_EXIT_STATUS(void);
typedef const char* (*zbx_get_pid_file_pathname_f)(void);
int zbx_daemon_start(int allow_root, const char *user, unsigned int flags,
zbx_get_pid_file_pathname_f get_pid_file_cb, zbx_on_exit_t zbx_on_exit_cb_arg);
void zbx_daemon_stop(void);
int zbx_sigusr_send(int flags, const char *pid_file_pathname);
void zbx_set_sigusr_handler(void (*handler)(int flags));
void zbx_signal_process_by_type(int proc_type, int proc_num, int flags, char **out);
void zbx_signal_process_by_pid(int pid, int flags, char **out);
#define ZBX_NONEXISTENT_SHMID (-1)
int zbx_shm_create(size_t size);
int zbx_shm_destroy(int shmid);
typedef void (*zbx_shm_copy_func_t)(void *dst, size_t size_dst, const void *src);
typedef struct
{
int shmid;
size_t size;
zbx_shm_copy_func_t copy_func;
zbx_mutex_t lock;
}
zbx_dshm_t;
typedef struct
{
int shmid;
void *addr;