2016-05-12 23:43:17 +03:00
|
|
|
/*
|
2019-06-20 02:58:25 +03:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2016-05-12 23:43:17 +03:00
|
|
|
*
|
2019-06-20 02:58:25 +03:00
|
|
|
* This software may be used and distributed according to the terms of the
|
|
|
|
* GNU General Public License version 2.
|
2016-05-12 23:43:17 +03:00
|
|
|
*/
|
2019-10-11 15:26:59 +03:00
|
|
|
|
2016-05-12 23:43:17 +03:00
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
2018-01-03 03:25:03 +03:00
|
|
|
#include "eden/fs/fuse/FuseTypes.h"
|
2016-05-12 23:43:17 +03:00
|
|
|
|
|
|
|
namespace facebook {
|
|
|
|
namespace eden {
|
|
|
|
|
|
|
|
// Some compatibility cruft for working with OSX Fuse
|
|
|
|
#if FUSE_MINOR_VERSION < 8
|
2018-01-04 20:57:06 +03:00
|
|
|
using fuse_pollhandle = void*;
|
2016-05-12 23:43:17 +03:00
|
|
|
#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();
|
|
|
|
};
|
2018-03-20 03:01:15 +03:00
|
|
|
|
2017-11-04 01:58:04 +03:00
|
|
|
} // namespace eden
|
|
|
|
} // namespace facebook
|