Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
monitor-fd.hh
1#pragma once
4
5#include <thread>
6#include <atomic>
7
8#include <poll.h>
9#include <sys/types.h>
10#include <unistd.h>
11
12#include "lix/libutil/error.hh"
14#include "lix/libutil/signals.hh"
16
17namespace nix {
18
20class MonitorFdHup
21{
22private:
23 std::thread thread;
27 Pipe terminatePipe;
28 std::atomic_bool quit = false;
29 std::function<void()> callback;
30
31 void runThread(int watchFd, int terminateFd);
32
33public:
34 MonitorFdHup(int fd, std::function<void()> callback = nix::triggerInterrupt);
35
36 ~MonitorFdHup();
37};
38
39
40}
Definition file-descriptor.hh:79
This file defines two main structs/classes used in nix error handling.