 #endif
 
 public final class Selector {
+    private var open: Bool
 #if os(Linux)
     private typealias EventType = epoll_event
     private let eventsCapacity = 2048

        eventfd = try wrapSyscall({ $0 >= 0 }, function: "eventfd") {
            CEventfd.eventfd(0, Int32(EFD_CLOEXEC | EFD_NONBLOCK))
        }

        var ev = epoll_event()
        ev.events = Selector.toEpollEvents(interested: .read)

#endif

    public func register(selectable: Selectable, interested: InterestedEvent = .read, attachment: AnyObject? = nil) throws {
        guard self.open else {
            throw IOError(errno: EBADF, reason: "can't register selector as it's not open anymore.")
        }

        assert(registrations[Int(selectable.descriptor)] == nil)
#if os(Linux)
        var ev = epoll_event()
