ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev_port.c
(Generate patch)

Comparing libev/ev_port.c (file contents):
Revision 1.18 by root, Tue Oct 20 19:06:55 2009 UTC vs.
Revision 1.20 by root, Fri Oct 15 22:14:05 2010 UTC

85 struct timespec ts; 85 struct timespec ts;
86 uint_t nget = 1; 86 uint_t nget = 1;
87 87
88 EV_RELEASE_CB; 88 EV_RELEASE_CB;
89 ts.tv_sec = (time_t)timeout; 89 ts.tv_sec = (time_t)timeout;
90 ts.tv_nsec = (long)(timeout - (ev_tstamp)ts.tv_sec) * 1e9; 90 ts.tv_nsec = ((long)(timeout - (ev_tstamp)ts.tv_sec) * 1e9);
91 res = port_getn (backend_fd, port_events, port_eventmax, &nget, &ts); 91 res = port_getn (backend_fd, port_events, port_eventmax, &nget, &ts);
92 EV_ACQUIRE_CB; 92 EV_ACQUIRE_CB;
93 93
94 if (res == -1) 94 if (res == -1)
95 { 95 {
125} 125}
126 126
127int inline_size 127int inline_size
128port_init (EV_P_ int flags) 128port_init (EV_P_ int flags)
129{ 129{
130 /* Initalize the kernel queue */ 130 /* Initialize the kernel queue */
131 if ((backend_fd = port_create ()) < 0) 131 if ((backend_fd = port_create ()) < 0)
132 return 0; 132 return 0;
133 133
134 fcntl (backend_fd, F_SETFD, FD_CLOEXEC); /* not sure if necessary, hopefully doesn't hurt */ 134 fcntl (backend_fd, F_SETFD, FD_CLOEXEC); /* not sure if necessary, hopefully doesn't hurt */
135 135
136 backend_fudge = 1e-3; /* needed to compensate for port_getn returning early */ 136 backend_fudge = 1e-3; /* needed to compensate for port_getn returning early */
137 backend_modify = port_modify; 137 backend_modify = port_modify;
138 backend_poll = port_poll; 138 backend_poll = port_poll;
139 139
140 port_eventmax = 64; /* intiial number of events receivable per poll */ 140 port_eventmax = 64; /* initial number of events receivable per poll */
141 port_events = (port_event_t *)ev_malloc (sizeof (port_event_t) * port_eventmax); 141 port_events = (port_event_t *)ev_malloc (sizeof (port_event_t) * port_eventmax);
142 142
143 return EVBACKEND_PORT; 143 return EVBACKEND_PORT;
144} 144}
145 145

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines