-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d31c38
commit 117bde3
Showing
6 changed files
with
61 additions
and
249 deletions.
There are no files selected for viewing
103 changes: 50 additions & 53 deletions
103
util/src/epoll_windows/sys/epoll.h → util/include/util/sys/epoll.h
100755 → 100644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,51 @@ | ||
|
||
#ifndef EPOLL_H_ | ||
#define EPOLL_H_ | ||
|
||
#include <WinSock2.h> | ||
#include <Windows.h> | ||
#include <stdint.h> | ||
|
||
#define EPOLLIN 0x001 | ||
// #define EPOLLPRI 0x002 | ||
#define EPOLLOUT 0x004 | ||
#define EPOLLERR 0x008 | ||
#define EPOLLHUP 0x010 | ||
#define EPOLLRDNORM 0x040 | ||
#define EPOLLRDBAND 0x080 | ||
#define EPOLLWRNORM 0x100 | ||
// #define EPOLLMSG 0x400 | ||
#define EPOLLWRBAND 0x200 | ||
#define EPOLLRDHUP 0x2000 | ||
|
||
/* #define EPOLLET (1 << 30) Not supported */ | ||
// #define EPOLLONESHOT (1 << 31) | ||
|
||
#define EPOLL_CTL_ADD 1 | ||
#define EPOLL_CTL_MOD 2 | ||
#define EPOLL_CTL_DEL 3 | ||
|
||
typedef void *epoll_t; | ||
|
||
typedef union epoll_data { | ||
void *ptr; | ||
int fd; | ||
uint32_t u32; | ||
uint64_t u64; | ||
// /* Windows-specific extensions. */ | ||
// SOCKET sock; | ||
// HANDLE hnd; | ||
} epoll_data_t; | ||
|
||
struct epoll_event | ||
{ | ||
uint32_t events; /* Epoll events */ | ||
epoll_data_t data; /* User data variable */ | ||
}; | ||
|
||
epoll_t epoll_create(int); | ||
|
||
int epoll_close(epoll_t epoll_hnd); | ||
|
||
int epoll_ctl(epoll_t epoll_hnd, int op, SOCKET sock, struct epoll_event *event); | ||
|
||
int epoll_wait(epoll_t epoll_hnd, struct epoll_event *events, int maxevents, int timeout); | ||
|
||
|
||
#ifndef EPOLL_H_ | ||
#define EPOLL_H_ | ||
|
||
#include <WinSock2.h> | ||
#include <Windows.h> | ||
#include <stdint.h> | ||
|
||
#define EPOLLIN 0x001 | ||
// #define EPOLLPRI 0x002 | ||
#define EPOLLOUT 0x004 | ||
#define EPOLLERR 0x008 | ||
#define EPOLLHUP 0x010 | ||
#define EPOLLRDNORM 0x040 | ||
#define EPOLLRDBAND 0x080 | ||
#define EPOLLWRNORM 0x100 | ||
// #define EPOLLMSG 0x400 | ||
#define EPOLLWRBAND 0x200 | ||
#define EPOLLRDHUP 0x2000 | ||
|
||
/* #define EPOLLET (1 << 30) Not supported */ | ||
// #define EPOLLONESHOT (1 << 31) | ||
|
||
#define EPOLL_CTL_ADD 1 | ||
#define EPOLL_CTL_MOD 2 | ||
#define EPOLL_CTL_DEL 3 | ||
|
||
typedef void *epoll_t; | ||
|
||
typedef union epoll_data { | ||
void *ptr; | ||
int fd; | ||
uint32_t u32; | ||
uint64_t u64; | ||
} epoll_data_t; | ||
|
||
struct epoll_event | ||
{ | ||
uint32_t events; /* Epoll events */ | ||
epoll_data_t data; /* User data variable */ | ||
}; | ||
|
||
epoll_t epoll_create(int); | ||
|
||
int epoll_close(epoll_t epoll_hnd); | ||
|
||
int epoll_ctl(epoll_t epoll_hnd, int op, SOCKET sock, struct epoll_event *event); | ||
|
||
int epoll_wait(epoll_t epoll_hnd, struct epoll_event *events, int maxevents, int timeout); | ||
|
||
#endif /* EPOLL_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "sys/epoll.h" | ||
#include "util/sys/epoll.h" | ||
#include "msafd.h" | ||
|
||
#include <unordered_map> | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters