Nix 2.26.3
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
4#include "file-descriptor.hh"
5#ifdef _WIN32
6# include "windows-async-pipe.hh"
7#endif
8
9#ifndef _WIN32
10# include <poll.h>
11#else
12# include <ioapiset.h>
13# include "windows-error.hh"
14#endif
15
16namespace nix {
17
27#ifndef _WIN32
28 Pipe
29#else
30 windows::AsyncPipe
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
64 windows::AsyncPipe *
65#endif
66 ;
67
76 void iterate(
77 std::set<CommChannel> & channels,
78 std::function<void(Descriptor fd, std::string_view data)> handleRead,
79 std::function<void(Descriptor fd)> handleEOF);
80};
81
82}
Definition file-descriptor.hh:181
int Descriptor
Definition file-descriptor.hh:20
std::variant< std::string, std::string_view > data
Definition lexer.l:177
return fd
Definition lexer.l:2948
Pipe MuxablePipe
Definition muxable-pipe.hh:26
Definition muxable-pipe.hh:40
void poll(std::optional< unsigned int > timeout)
void iterate(std::set< CommChannel > &channels, std::function< void(Descriptor fd, std::string_view data)> handleRead, std::function< void(Descriptor fd)> handleEOF)