ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/libeio/eio.c
(Generate patch)

Comparing cvsroot/libeio/eio.c (file contents):
Revision 1.42 by root, Mon Jun 15 05:34:49 2009 UTC vs.
Revision 1.44 by root, Thu Nov 26 05:25:35 2009 UTC

196 196
197/*****************************************************************************/ 197/*****************************************************************************/
198 198
199#define ETP_NUM_PRI (ETP_PRI_MAX - ETP_PRI_MIN + 1) 199#define ETP_NUM_PRI (ETP_PRI_MAX - ETP_PRI_MIN + 1)
200 200
201/* calculcate time difference in ~1/EIO_TICKS of a second */ 201/* calculate time difference in ~1/EIO_TICKS of a second */
202static int tvdiff (struct timeval *tv1, struct timeval *tv2) 202static int tvdiff (struct timeval *tv1, struct timeval *tv2)
203{ 203{
204 return (tv2->tv_sec - tv1->tv_sec ) * EIO_TICKS 204 return (tv2->tv_sec - tv1->tv_sec ) * EIO_TICKS
205 + ((tv2->tv_usec - tv1->tv_usec) >> 10); 205 + ((tv2->tv_usec - tv1->tv_usec) >> 10);
206} 206}
598} 598}
599 599
600static void etp_set_max_poll_time (double nseconds) 600static void etp_set_max_poll_time (double nseconds)
601{ 601{
602 if (WORDACCESS_UNSAFE) X_LOCK (reslock); 602 if (WORDACCESS_UNSAFE) X_LOCK (reslock);
603 max_poll_time = nseconds; 603 max_poll_time = nseconds * EIO_TICKS;
604 if (WORDACCESS_UNSAFE) X_UNLOCK (reslock); 604 if (WORDACCESS_UNSAFE) X_UNLOCK (reslock);
605} 605}
606 606
607static void etp_set_max_poll_reqs (unsigned int maxreqs) 607static void etp_set_max_poll_reqs (unsigned int maxreqs)
608{ 608{
867 if (!res || errno != ENOSYS) 867 if (!res || errno != ENOSYS)
868 return res; 868 return res;
869#endif 869#endif
870 870
871 /* even though we could play tricks with the flags, it's better to always 871 /* even though we could play tricks with the flags, it's better to always
872 * call fdatasync, as thta matches the expectation of it's users best */ 872 * call fdatasync, as that matches the expectation of its users best */
873 return fdatasync (fd); 873 return fdatasync (fd);
874} 874}
875 875
876#if !HAVE_READAHEAD 876#if !HAVE_READAHEAD
877# undef readahead 877# undef readahead

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines