]> git.proxmox.com Git - ceph.git/blob - ceph/src/msg/async/EventSelect.h
bump version to 12.0.3-pve3
[ceph.git] / ceph / src / msg / async / EventSelect.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2014 UnitedStack <haomai@unitedstack.com>
7 *
8 * Author: Haomai Wang <haomaiwang@gmail.com>
9 *
10 * This is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License version 2.1, as published by the Free Software
13 * Foundation. See file COPYING.
14 *
15 */
16
17 #ifndef CEPH_MSG_EVENTSELECT_H
18 #define CEPH_MSG_EVENTSELECT_H
19
20 #include "Event.h"
21
22 class SelectDriver : public EventDriver {
23 fd_set rfds, wfds;
24 /* We need to have a copy of the fd sets as it's not safe to reuse
25 * FD sets after select(). */
26 fd_set _rfds, _wfds;
27 int max_fd;
28 CephContext *cct;
29
30 public:
31 explicit SelectDriver(CephContext *c): max_fd(0), cct(c) {}
32 ~SelectDriver() override {}
33
34 int init(EventCenter *c, int nevent) override;
35 int add_event(int fd, int cur_mask, int add_mask) override;
36 int del_event(int fd, int cur_mask, int del_mask) override;
37 int resize_events(int newsize) override;
38 int event_wait(vector<FiredFileEvent> &fired_events,
39 struct timeval *tp) override;
40 };
41
42 #endif