Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
file-descriptor-private.hh
1#pragma once
2
4#include "nix/util/result.hh"
6
7namespace nix {
8
9struct FdSink;
10
23bool tryCopyFdRangeFast(Descriptor from, Descriptor to, off_t offset, size_t nbytes, size_t & written);
24
31{
32 if (fd == INVALID_DESCRIPTOR)
33 return outcome::failure(NativeSysError::ambientError());
34 return outcome::success(AutoCloseFD{fd});
35}
36
37} // namespace nix
Definition file-descriptor.hh:265
File descriptor operations for almost arbitrary file descriptors.
int Descriptor
Definition file-descriptor.hh:36
outcome::unchecked< T, E > Result
Definition result.hh:24
Definition serialise.hh:194
static int ambientError()
Definition system-error.hh:244
Errors from the operating system: SystemError, and its subclasses for the native error codes,...