sapling/eden/fs/fuse/PollHandle.h
Xavier Deguillard a29d465ee8 fs: fix license header
Summary:
With Facebook having been renamed Meta Platforms, we need to change the license
headers.

Reviewed By: fanzeyi

Differential Revision: D33407812

fbshipit-source-id: b11bfbbf13a48873f0cea75f212cc7b07a68fb2e
2022-01-04 15:00:07 -08:00

38 lines
876 B
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#pragma once
#include <memory>
#include "eden/fs/utils/FsChannelTypes.h"
namespace facebook::eden {
// Some compatibility cruft for working with OSX Fuse
#if FUSE_MINOR_VERSION < 8
using fuse_pollhandle = void*;
#endif
class PollHandle {
struct Deleter {
void operator()(fuse_pollhandle*);
};
std::unique_ptr<fuse_pollhandle, Deleter> h_;
public:
PollHandle(const PollHandle&) = delete;
PollHandle& operator=(const PollHandle&) = delete;
PollHandle(PollHandle&&) = default;
PollHandle& operator=(PollHandle&&) = default;
explicit PollHandle(fuse_pollhandle* h);
// Requests that the kernel poll the associated file
void notify();
};
} // namespace facebook::eden