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

Comparing libev/ev_select.c (file contents):
Revision 1.5 by root, Wed Oct 31 17:55:55 2007 UTC vs.
Revision 1.7 by root, Thu Nov 1 13:11:12 2007 UTC

1/* 1/*
2 * libev select fd activity backend
3 *
2 * Copyright (c) 2007 Marc Alexander Lehmann <libev@schmorp.de> 4 * Copyright (c) 2007 Marc Alexander Lehmann <libev@schmorp.de>
3 * All rights reserved. 5 * All rights reserved.
4 * 6 *
5 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 8 * modification, are permitted provided that the following conditions are
68 vec_wi [offs] |= mask; 70 vec_wi [offs] |= mask;
69 if (!(nev & EV_WRITE)) 71 if (!(nev & EV_WRITE))
70 vec_wi [offs] &= ~mask; 72 vec_wi [offs] &= ~mask;
71} 73}
72 74
75static void
73static void select_poll (ev_tstamp timeout) 76select_poll (ev_tstamp timeout)
74{ 77{
75 struct timeval tv; 78 struct timeval tv;
76 int res; 79 int res;
77 80
78 memcpy (vec_ro, vec_ri, vec_max * 4); 81 memcpy (vec_ro, vec_ri, vec_max * 4);
115 if (errno == EBADF) 118 if (errno == EBADF)
116 fd_recheck (); 119 fd_recheck ();
117 } 120 }
118} 121}
119 122
123static void
120void select_init (int flags) 124select_init (int flags)
121{ 125{
122 ev_method = EVMETHOD_SELECT; 126 ev_method = EVMETHOD_SELECT;
123 method_fudge = 1e-2; /* needed to compensate for select returning early, very conservative */ 127 method_fudge = 1e-2; /* needed to compensate for select returning early, very conservative */
124 method_modify = select_modify; 128 method_modify = select_modify;
125 method_poll = select_poll; 129 method_poll = select_poll;
126} 130}
127 131
128

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines