1
To compile TrafficServer with libev
3
1. Get the libev source by either:
4
a. Pull the libev source into the root of the TS source
5
cvs -z3 -d :pserver:anonymous@cvs.schmorp.de/schmorpforge co libev
9
b. Download libev tar ball e.g. libev-3.8.tar.gz and extract into
10
toplevel TS source directory. Next symlink the extracted directory
11
to 'libev' e.g. 'ln -s libev-3.8 libev'.
13
2. Apply the patch at the end of this file (after CUT HERE) to the libev source
15
3. In the libev directory
17
b. ./configure CFLAGS="$CFLAGS -Dinline_size= -DEV_MINPRI=0 -DEV_MAXPRI=0"
20
4. Configure trafffic server with '--enable-libev'.
23
------------------------ CUT HERE ----------------
25
===================================================================
26
RCS file: /schmorpforge/libev/ev.c,v
27
retrieving revision 1.320
29
--- ev.c 4 Dec 2009 20:25:06 -0000 1.320
30
+++ ev.c 25 Feb 2010 17:24:18 -0000
33
#define expect_false(expr) expect ((expr) != 0, 0)
34
#define expect_true(expr) expect ((expr) != 0, 1)
36
#define inline_size static inline
40
# define inline_speed static noinline
42
===================================================================
43
RCS file: /schmorpforge/libev/ev_poll.c,v
44
retrieving revision 1.31
45
diff -u -r1.31 ev_poll.c
46
--- ev_poll.c 19 Jul 2009 04:11:27 -0000 1.31
47
+++ ev_poll.c 25 Feb 2010 17:24:18 -0000
49
else if (errno != EINTR)
50
ev_syserr ("(libev) poll");
53
- for (p = polls; res; ++p)
56
+ for (i = 0; i < pollcnt; i++) {
58
if (expect_false (p->revents)) /* this expect is debatable */
62
if (expect_false (p->revents & POLLNVAL))
63
fd_kill (EV_A_ p->fd);
66
| (p->revents & (POLLIN | POLLERR | POLLHUP) ? EV_READ : 0)