diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-01-04 06:17:51 +0400 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-01-04 06:18:42 +0400 |
commit | 17f4e41ecb80f70c14493b4518e6eabec9faff7b (patch) | |
tree | b202846552dd39b6b39de953929c75e3381de47a /uloop.h | |
parent | c2916d7bcca129152fbbbbedcd9990706df8760a (diff) |
uloop: improve edge trigger reliability on mac os x
Sometimes after re-arming a fd, an initial event for reads is not generated,
even though there is data pending. Work around this by making the trigger
level-triggered first, then switching to edge trigger after processing the first
event.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'uloop.h')
-rw-r--r-- | uloop.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -46,6 +46,9 @@ typedef void (*uloop_process_handler)(struct uloop_process *c, int ret); #define ULOOP_WRITE (1 << 1) #define ULOOP_EDGE_TRIGGER (1 << 2) #define ULOOP_BLOCKING (1 << 3) +#ifdef USE_KQUEUE +#define ULOOP_EDGE_DEFER (1 << 4) +#endif struct uloop_fd { @@ -54,6 +57,9 @@ struct uloop_fd bool eof; bool error; bool registered; +#ifdef USE_KQUEUE + bool flags; +#endif }; struct uloop_timeout |