⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 common.h

📁 linux写的基于epoll技术的通信服务器
💻 H
字号:
/* -------------------------------------------------------------------------
 * common.h 
 * -------------------------------------------------------------------------
 */

#ifndef __COMMON_H
#define __COMMON_H

#include <netinet/in.h>
#include <time.h>

#ifdef _DEBUG
#define dprintf lprintf
#else
#define dprintf(...)
#endif



/* Become a daemon: fork, die, setsid, fork, die, disconnect */
void daemonize( void );

/* Check the validity of the configuration data */
/*int config_check( config_data_t *c );
*/
/* Drop privileges to nobody. Optional reason for log */
void dropprivs(char *reason);

/* Get root privileges back. Optional reason for log */
void getprivs(char *reason);

/* initialize signames[] array */
/*void init_signames(void);
*/
/* Variables used by other modules */
//extern log_t *log;
/*extern config_data_t *config;*/
/*extern char *signames[64]; *//* 64 names of signals */

#endif /* _COMMON_DEFS_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -