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.8 by root, Fri Nov 2 16:54:35 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);
111 } 114 }
112 } 115 }
113 else if (res < 0) 116 else if (res < 0)
114 { 117 {
115 if (errno == EBADF) 118 if (errno == EBADF)
119 fd_ebadf ();
120 else if (errno == ENOMEM)
116 fd_recheck (); 121 fd_enomem ();
117 } 122 }
118} 123}
119 124
125static void
120void select_init (int flags) 126select_init (int flags)
121{ 127{
122 ev_method = EVMETHOD_SELECT; 128 ev_method = EVMETHOD_SELECT;
123 method_fudge = 1e-2; /* needed to compensate for select returning early, very conservative */ 129 method_fudge = 1e-2; /* needed to compensate for select returning early, very conservative */
124 method_modify = select_modify; 130 method_modify = select_modify;
125 method_poll = select_poll; 131 method_poll = select_poll;
126} 132}
127 133
128

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines