/*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2004-present Facebook, Inc.
*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
+
#pragma once
+#include <cstddef>
+
+#include <boost/noncopyable.hpp>
#include <glog/logging.h>
+
#include <folly/io/async/EventUtil.h>
#include <folly/portability/Event.h>
-#include <boost/noncopyable.hpp>
-#include <stddef.h>
namespace folly {
READ = EV_READ,
WRITE = EV_WRITE,
READ_WRITE = (READ | WRITE),
- PERSIST = EV_PERSIST
+ PERSIST = EV_PERSIST,
+// Temporary flag until EPOLLPRI is upstream on libevent.
+#ifdef EV_PRI
+ PRI = EV_PRI,
+#endif
};
/**
* Return the set of events that we're currently registered for.
*/
uint16_t getRegisteredEvents() const {
- return (isHandlerRegistered()) ?
- event_.ev_events : 0;
+ return (isHandlerRegistered()) ? uint16_t(event_.ev_events) : 0u;
}
/**
EventBase* eventBase_;
};
-} // folly
+} // namespace folly