process_unlock();
}
-static int lxc_cmd_handler(int fd, void *data, struct lxc_epoll_descr *descr)
+static int lxc_cmd_handler(int fd, uint32_t events, void *data,
+ struct lxc_epoll_descr *descr)
{
int ret;
struct lxc_cmd_req req;
goto out;
}
-static int lxc_cmd_accept(int fd, void *data, struct lxc_epoll_descr *descr)
+static int lxc_cmd_accept(int fd, uint32_t events, void *data,
+ struct lxc_epoll_descr *descr)
{
int opt = 1, ret = -1, connection;
}
}
-static int lxc_console_cb_sigwinch_fd(int fd, void *cbdata,
+static int lxc_console_cb_sigwinch_fd(int fd, uint32_t events, void *cbdata,
struct lxc_epoll_descr *descr)
{
struct signalfd_siginfo siginfo;
free(ts);
}
-static int lxc_console_cb_con(int fd, void *data,
+static int lxc_console_cb_con(int fd, uint32_t events, void *data,
struct lxc_epoll_descr *descr)
{
struct lxc_console *console = (struct lxc_console *)data;
-static int lxc_console_cb_tty_stdin(int fd, void *cbdata,
+static int lxc_console_cb_tty_stdin(int fd, uint32_t events, void *cbdata,
struct lxc_epoll_descr *descr)
{
struct lxc_tty_state *ts = cbdata;
return 0;
}
-static int lxc_console_cb_tty_master(int fd, void *cbdata,
+static int lxc_console_cb_tty_master(int fd, uint32_t events, void *cbdata,
struct lxc_epoll_descr *descr)
{
struct lxc_tty_state *ts = cbdata;
mon->clientfds_cnt--;
}
-static int lxc_monitord_sock_handler(int fd, void *data,
+static int lxc_monitord_sock_handler(int fd, uint32_t events, void *data,
struct lxc_epoll_descr *descr)
{
struct lxc_monitor *mon = data;
return 0;
}
-static int lxc_monitord_sock_accept(int fd, void *data,
+static int lxc_monitord_sock_accept(int fd, uint32_t events, void *data,
struct lxc_epoll_descr *descr)
{
int ret,clientfd;
mon->clientfds_cnt = 0;
}
-static int lxc_monitord_fifo_handler(int fd, void *data,
+static int lxc_monitord_fifo_handler(int fd, uint32_t events, void *data,
struct lxc_epoll_descr *descr)
{
int ret,i;
static int utmp_get_runlevel(struct lxc_utmp *utmp_data);
static int utmp_get_ntasks(struct lxc_handler *handler);
-static int utmp_shutdown_handler(int fd, void *data,
+static int utmp_shutdown_handler(int fd, uint32_t events, void *data,
struct lxc_epoll_descr *descr);
static int lxc_utmp_add_timer(struct lxc_epoll_descr *descr,
lxc_mainloop_callback_t callback, void *data);
static int lxc_utmp_del_timer(struct lxc_epoll_descr *descr,
struct lxc_utmp *utmp_data);
-static int utmp_handler(int fd, void *data, struct lxc_epoll_descr *descr)
+static int utmp_handler(int fd, uint32_t events, void *data,
+ struct lxc_epoll_descr *descr)
{
struct inotify_event *ie;
int size, ret, length;
return -1;
}
-static int utmp_shutdown_handler(int fd, void *data,
+static int utmp_shutdown_handler(int fd, uint32_t events, void *data,
struct lxc_epoll_descr *descr)
{
int ntasks;
/* If the handler returns a positive value, exit
the mainloop */
- if (handler->callback(handler->fd, handler->data,
- descr) > 0)
+ if (handler->callback(handler->fd, events[i].events,
+ handler->data, descr) > 0)
return 0;
}
#ifndef _mainloop_h
#define _mainloop_h
+#include <stdint.h>
#include "list.h"
struct lxc_epoll_descr {
struct lxc_list handlers;
};
-typedef int (*lxc_mainloop_callback_t)(int fd, void *data,
+typedef int (*lxc_mainloop_callback_t)(int fd, uint32_t event, void *data,
struct lxc_epoll_descr *descr);
extern int lxc_mainloop(struct lxc_epoll_descr *descr, int timeout_ms);
return fd;
}
-static int signal_handler(int fd, void *data,
+static int signal_handler(int fd, uint32_t events, void *data,
struct lxc_epoll_descr *descr)
{
struct signalfd_siginfo siginfo;