/*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <folly/io/ShutdownSocketSet.h>
-#include <sys/socket.h>
#include <sys/types.h>
#include <chrono>
#include <folly/FileUtil.h>
#include <folly/Malloc.h>
+#include <folly/portability/Sockets.h>
namespace folly {
-ShutdownSocketSet::ShutdownSocketSet(size_t maxFd)
+ShutdownSocketSet::ShutdownSocketSet(int maxFd)
: maxFd_(maxFd),
data_(static_cast<std::atomic<uint8_t>*>(
folly::checkedCalloc(maxFd, sizeof(std::atomic<uint8_t>)))),
}
void ShutdownSocketSet::shutdownAll(bool abortive) {
- for (size_t i = 0; i < maxFd_; ++i) {
+ for (int i = 0; i < maxFd_; ++i) {
auto& sref = data_[i];
if (sref.load(std::memory_order_acquire) == IN_USE) {
shutdown(i, abortive);