tevent_common_schedule_immediate: void (struct tevent_immediate *, struct tevent_context *, tevent_immediate_handler_t, void *, const char *, const char *)
tevent_common_threaded_activate_immediate: void (struct tevent_context *)
tevent_common_wakeup: int (struct tevent_context *)
+tevent_common_wakeup_fd: int (int)
tevent_common_wakeup_init: int (struct tevent_context *)
tevent_context_init: struct tevent_context *(TALLOC_CTX *)
tevent_context_init_byname: struct tevent_context *(TALLOC_CTX *, const char *)
return 0;
}
-int tevent_common_wakeup(struct tevent_context *ev)
+int tevent_common_wakeup_fd(int fd)
{
ssize_t ret;
- if (ev->wakeup_fde == NULL) {
- return ENOTCONN;
- }
-
do {
#ifdef HAVE_EVENTFD
uint64_t val = 1;
- ret = write(ev->wakeup_fd, &val, sizeof(val));
+ ret = write(fd, &val, sizeof(val));
#else
char c = '\0';
- ret = write(ev->wakeup_fd, &c, 1);
+ ret = write(fd, &c, 1);
#endif
} while ((ret == -1) && (errno == EINTR));
return 0;
}
+int tevent_common_wakeup(struct tevent_context *ev)
+{
+ if (ev->wakeup_fde == NULL) {
+ return ENOTCONN;
+ }
+
+ return tevent_common_wakeup_fd(ev->wakeup_fd);
+}
+
static void tevent_common_wakeup_fini(struct tevent_context *ev)
{
if (ev->wakeup_fde == NULL) {
bool tevent_common_have_events(struct tevent_context *ev);
int tevent_common_wakeup_init(struct tevent_context *ev);
+int tevent_common_wakeup_fd(int fd);
int tevent_common_wakeup(struct tevent_context *ev);
struct tevent_signal *tevent_common_add_signal(struct tevent_context *ev,