 			n.lock.doWithLock {
 				if let _ = n.queuedSockets[socket] {
 #if os(Linux)
-					epoll_ctl(n.kq, DELETE, socket, nil)
-#else
-					var kvt = mykevent(ident: UInt(socket), filter: Filter.Delete.rawValue, flags: UInt16(EV_DELETE), fflags: 0, data: 0, udata: nil)
+					epoll_ctl(n.kq, EPOLL_CTL_DEL, socket, nil)
+#else
+					var kvt = event(ident: UInt(socket), filter: Int16(EV_DELETE), flags: UInt16(EV_DELETE), fflags: 0, data: 0, udata: nil)
 					var tmout = timespec(tv_sec: 0, tv_nsec: 0)
 					kevent(n.kq, &kvt, 1, nil, 0, &tmout)
 #endif


		static let None = Filter(rawValue: UInt32(FLAG_NONE))
		static let Error = Filter(rawValue: UInt32(ERROR))
		static let Delete = Filter(rawValue: UInt32(DELETE))
		static let Read = Filter(rawValue: UInt32(FILT_READ))
		static let Write = Filter(rawValue: UInt32(FILT_WRITE))
		static let Timer = Filter(rawValue: UInt32(FILT_TIMER))


import Darwin

private let FILT_READ = EVFILT_READ
private let FILT_WRITE = EVFILT_WRITE
private let FILT_TIMER = EVFILT_TIMER
