Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
epoll_create* ignores size hint in newer kernels, switch to new API (t…
Browse files Browse the repository at this point in the history
…witter#179)

* epoll_create* ignores size hint in newer kernels, use new API

* update error message as well
  • Loading branch information
thinkingfish authored and kevyang committed Oct 10, 2018
1 parent c9c5ee5 commit 4c0668b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions include/cc_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ extern "C" {

#include <inttypes.h>

#define EVENT_SIZE 1024

#define EVENT_READ 0x0000ff
#define EVENT_WRITE 0x00ff00
#define EVENT_ERR 0xff0000
Expand All @@ -51,7 +49,7 @@ void event_setup(event_metrics_st *metrics);
void event_teardown(void);

/* event base */
struct event_base *event_base_create(int size, event_cb_fn cb);
struct event_base *event_base_create(int nevent, event_cb_fn cb);
void event_base_destroy(struct event_base **evb);

/* event control */
Expand Down
4 changes: 2 additions & 2 deletions src/event/cc_epoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ event_base_create(int nevent, event_cb_fn cb)

ASSERT(nevent > 0);

ep = epoll_create(nevent);
ep = epoll_create1(0);
if (ep < 0) {
log_error("epoll create size %d failed: %s", nevent, strerror(errno));
log_error("epoll create1 failed: %s", strerror(errno));
return NULL;
}

Expand Down

0 comments on commit 4c0668b

Please sign in to comment.