Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
muxable-pipe.hh
Go to the documentation of this file.
1#pragma once
3
5#include "nix/util/fun.hh"
6#ifdef _WIN32
8#endif
9
10#ifndef _WIN32
11# include <poll.h>
12#else
13# include <ioapiset.h>
14#endif
15
16namespace nix {
17
27#ifndef _WIN32
28 Pipe
29#else
31#endif
32 ;
33
40{
41#ifndef _WIN32
42 std::vector<struct pollfd> pollStatus;
43 std::map<int, size_t> fdToPollStatus;
44#else
45 OVERLAPPED_ENTRY oentries[0x20] = {0};
46 ULONG removed;
47 bool gotEOF = false;
48
49#endif
50
54 void poll(
55#ifdef _WIN32
56 HANDLE ioport,
57#endif
58 std::optional<unsigned int> timeout);
59
60 using CommChannel =
61#ifndef _WIN32
63#else
65#endif
66 ;
67
76 void iterate(
77 std::set<CommChannel> & channels,
78 fun<void(Descriptor fd, std::string_view data)> handleRead,
79 fun<void(Descriptor fd)> handleEOF);
80};
81
82} // namespace nix
Definition file-descriptor.hh:331
Definition fun.hh:19
Definition windows-async-pipe.hh:16
File descriptor operations for almost arbitrary file descriptors.
int Descriptor
Definition file-descriptor.hh:36
Pipe MuxablePipe
Definition muxable-pipe.hh:26
Definition muxable-pipe.hh:40
void poll(std::optional< unsigned int > timeout)
Definition muxable-pipe.cc:9
void iterate(std::set< CommChannel > &channels, fun< void(Descriptor fd, std::string_view data)> handleRead, fun< void(Descriptor fd)> handleEOF)
Definition muxable-pipe.cc:18