18#if !defined(OPENVPN_PLATFORM_WIN)
30#if !defined(OPENVPN_PLATFORM_WIN)
38#if defined(OPENVPN_PLATFORM_WIN)
40inline void write_private(
const std::string &path,
const void *buf,
size_t count)
47inline void write_private(
const std::string &path,
const void *buf, ssize_t count)
49 ScopedFD fd(::open(path.c_str(), O_WRONLY | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR));
52 const int eno = errno;
55 if (::ftruncate(fd(), 0) < 0)
57 const int eno = errno;
63 const int eno = errno;
66 else if (len != count)
70 const int eno = errno;
const T * c_data() const
Returns a const pointer to the start of the buffer.
size_t size() const
Returns the size of the buffer in T objects.
#define OPENVPN_THROW_EXCEPTION(stuff)
ssize_t write_retry(int fd, const void *buf, size_t count)
void write_private(const std::string &path, const void *buf, ssize_t count)
std::string strerror_str(const int errnum)
os<< "Session Name: "<< tbc-> session_name<< '\n';os<< "Layer: "<< tbc-> layer str()<< '\n'