18#if defined(OPENVPN_PLATFORM_WIN)
19#error atomic file methods not supported on Windows
36 const std::string &tmpdir,
38 const std::uint64_t mtime_ns,
49 if (::rename(tfn.c_str(), fn.c_str()) == -1)
51 const int eno = errno;
52 ::unlink(tfn.c_str());
58 const std::string &tmpdir,
60 const std::uint64_t mtime_ns,
Abstract base class for cryptographically strong random number generators.
#define OPENVPN_THROW(exc, stuff)
Support deferred server-side state creation when client connects.
std::string tmp_filename(const std::string &fn, const std::string &tmpdir, StrongRandomAPI &rng)
void write_binary_unix(const std::string &fn, const mode_t mode, const std::uint64_t mtime_ns, const void *buf, const ssize_t size)
ConstBufferType< T > & const_buffer_ref(BufferType< T > &src)
void write_binary_atomic(const std::string &fn, const std::string &tmpdir, const mode_t mode, const std::uint64_t mtime_ns, const ConstBuffer &buf, StrongRandomAPI &rng)
std::string strerror_str(const int errnum)