mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
* Daemon mode (`nix-worker --daemon'). Clients connect to the server
via the Unix domain socket in /nix/var/nix/daemon.socket. The server forks a worker process per connection. * readString(): use the heap, not the stack. * Some protocol fixes.
This commit is contained in:
parent
4740baf3a6
commit
0130ef88ea
7 changed files with 182 additions and 53 deletions
|
@ -139,6 +139,8 @@ extern void (*writeToStderr) (const unsigned char * buf, size_t count);
|
|||
void readFull(int fd, unsigned char * buf, size_t count);
|
||||
void writeFull(int fd, const unsigned char * buf, size_t count);
|
||||
|
||||
MakeError(EndOfFile, Error)
|
||||
|
||||
|
||||
/* Read a file descriptor until EOF occurs. */
|
||||
string drainFD(int fd);
|
||||
|
@ -147,6 +149,19 @@ string drainFD(int fd);
|
|||
|
||||
/* Automatic cleanup of resources. */
|
||||
|
||||
|
||||
template <class T>
|
||||
struct AutoDeleteArray
|
||||
{
|
||||
T * p;
|
||||
AutoDeleteArray(T * p) : p(p) { }
|
||||
~AutoDeleteArray()
|
||||
{
|
||||
delete [] p;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class AutoDelete
|
||||
{
|
||||
string path;
|
||||
|
@ -229,6 +244,8 @@ void inline checkInterrupt()
|
|||
if (_isInterrupted) _interrupted();
|
||||
}
|
||||
|
||||
MakeError(Interrupted, Error)
|
||||
|
||||
|
||||
/* String packing / unpacking. */
|
||||
string packStrings(const Strings & strings);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue