epoll: add global init function

This commit is contained in:
Bert Belder 2017-09-25 17:57:58 +02:00
parent 049a7b8be2
commit 16f62017ba
3 changed files with 14 additions and 1 deletions

8
src/epoll-init.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef EPOLL_EPOLL_INIT_H_
#define EPOLL_EPOLL_INIT_H_
#include "internal.h"
EPOLL_INTERNAL int epoll_global_init(void);
#endif /* EPOLL_EPOLL_INIT_H_ */

View File

@ -11,6 +11,10 @@
#define _EPOLL_MAX_COMPLETION_COUNT 64
int epoll_global_init(void) {
return 0;
}
epoll_t epoll_create(void) {
ep_port_t* port_info;
HANDLE iocp;

View File

@ -1,5 +1,6 @@
#include <stdbool.h>
#include "epoll-init.h"
#include "error.h"
#include "init.h"
#include "nt.h"
@ -21,7 +22,7 @@ static int _winsock_global_init(void) {
static int _init_once(void) {
if (_winsock_global_init() < 0 || nt_global_init() < 0 ||
reflock_global_init() < 0)
reflock_global_init() < 0 || epoll_global_init() < 0)
return -1;
_initialized = true;