… | |
… | |
109 | if ((port_fd = port_create ()) < 0) |
109 | if ((port_fd = port_create ()) < 0) |
110 | return 0; |
110 | return 0; |
111 | |
111 | |
112 | fcntl (port_fd, F_SETFD, FD_CLOEXEC); /* not sure if necessary, hopefully doesn't hurt */ |
112 | fcntl (port_fd, F_SETFD, FD_CLOEXEC); /* not sure if necessary, hopefully doesn't hurt */ |
113 | |
113 | |
114 | method_fudge = 1e-3; /* needed to compensate for port_getn returning early */ |
114 | backend_fudge = 1e-3; /* needed to compensate for port_getn returning early */ |
115 | method_modify = port_modify; |
115 | backend_modify = port_modify; |
116 | method_poll = port_poll; |
116 | backend_poll = port_poll; |
117 | |
117 | |
118 | port_eventmax = 64; /* intiial number of events receivable per poll */ |
118 | port_eventmax = 64; /* intiial number of events receivable per poll */ |
119 | port_events = (port_event_t *)ev_malloc (sizeof (port_event_t) * port_eventmax); |
119 | port_events = (port_event_t *)ev_malloc (sizeof (port_event_t) * port_eventmax); |
120 | |
120 | |
121 | return EVBACKEND_PORT; |
121 | return EVBACKEND_PORT; |