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

Comparing libev/ev.c (file contents):
Revision 1.510 by root, Wed Aug 28 09:45:49 2019 UTC vs.
Revision 1.514 by root, Fri Dec 20 05:20:50 2019 UTC

124# else 124# else
125# undef EV_USE_LINUXAIO 125# undef EV_USE_LINUXAIO
126# define EV_USE_LINUXAIO 0 126# define EV_USE_LINUXAIO 0
127# endif 127# endif
128 128
129# if HAVE_LINUX_FS_H && HAVE_SYS_TIMERFD_H && HAVE_KERNEL_RWF_T
130# ifndef EV_USE_IOURING
131# define EV_USE_IOURING EV_FEATURE_BACKENDS
132# endif
133# else
134# undef EV_USE_IOURING
135# define EV_USE_IOURING 0
136# endif
137
129# if HAVE_KQUEUE && HAVE_SYS_EVENT_H 138# if HAVE_KQUEUE && HAVE_SYS_EVENT_H
130# ifndef EV_USE_KQUEUE 139# ifndef EV_USE_KQUEUE
131# define EV_USE_KQUEUE EV_FEATURE_BACKENDS 140# define EV_USE_KQUEUE EV_FEATURE_BACKENDS
132# endif 141# endif
133# else 142# else
168# endif 177# endif
169# else 178# else
170# undef EV_USE_EVENTFD 179# undef EV_USE_EVENTFD
171# define EV_USE_EVENTFD 0 180# define EV_USE_EVENTFD 0
172# endif 181# endif
173 182
174#endif 183#endif
175 184
176/* OS X, in its infinite idiocy, actually HARDCODES 185/* OS X, in its infinite idiocy, actually HARDCODES
177 * a limit of 1024 into their select. Where people have brains, 186 * a limit of 1024 into their select. Where people have brains,
178 * OS X engineers apparently have a vacuum. Or maybe they were 187 * OS X engineers apparently have a vacuum. Or maybe they were
333# define EV_USE_LINUXAIO 0 342# define EV_USE_LINUXAIO 0
334# endif 343# endif
335#endif 344#endif
336 345
337#ifndef EV_USE_IOURING 346#ifndef EV_USE_IOURING
338# if __linux 347# if __linux /* later checks might disable again */
339# define EV_USE_IOURING 0 348# define EV_USE_IOURING 1
340# else 349# else
341# define EV_USE_IOURING 0 350# define EV_USE_IOURING 0
342# endif 351# endif
343#endif 352#endif
344 353
436#endif 445#endif
437 446
438#if !EV_STAT_ENABLE 447#if !EV_STAT_ENABLE
439# undef EV_USE_INOTIFY 448# undef EV_USE_INOTIFY
440# define EV_USE_INOTIFY 0 449# define EV_USE_INOTIFY 0
450#endif
451
452#if __linux && EV_USE_IOURING
453# include <linux/version.h>
454# if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)
455# undef EV_USE_IOURING
456# define EV_USE_IOURING 0
457# endif
441#endif 458#endif
442 459
443#if !EV_USE_NANOSLEEP 460#if !EV_USE_NANOSLEEP
444/* hp-ux has it in sys/time.h, which we unconditionally include above */ 461/* hp-ux has it in sys/time.h, which we unconditionally include above */
445# if !defined _WIN32 && !defined __hpux 462# if !defined _WIN32 && !defined __hpux
3841 3858
3842 /* don't let timeouts decrease the waittime below timeout_blocktime */ 3859 /* don't let timeouts decrease the waittime below timeout_blocktime */
3843 if (ecb_expect_false (waittime < timeout_blocktime)) 3860 if (ecb_expect_false (waittime < timeout_blocktime))
3844 waittime = timeout_blocktime; 3861 waittime = timeout_blocktime;
3845 3862
3846 /* at this point, we NEED to wait, so we have to ensure */ 3863 /* now there are two more special cases left, either we have
3847 /* to pass a minimum nonzero value to the backend */ 3864 * already-expired timers, so we should not sleep, or we have timers
3865 * that expire very soon, in which case we need to wait for a minimum
3866 * amount of time for some event loop backends.
3867 */
3848 if (ecb_expect_false (waittime < backend_mintime)) 3868 if (ecb_expect_false (waittime < backend_mintime))
3869 waittime = waittime <= EV_TS_CONST (0.)
3870 ? EV_TS_CONST (0.)
3849 waittime = backend_mintime; 3871 : backend_mintime;
3850 3872
3851 /* extra check because io_blocktime is commonly 0 */ 3873 /* extra check because io_blocktime is commonly 0 */
3852 if (ecb_expect_false (io_blocktime)) 3874 if (ecb_expect_false (io_blocktime))
3853 { 3875 {
3854 sleeptime = io_blocktime - (mn_now - prev_mn_now); 3876 sleeptime = io_blocktime - (mn_now - prev_mn_now);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines