31 LOG(
"posix::date_format::now");
38 ::localtime_r(&t,&tm);
48 size_t cret=::strftime(buf,len,
format.c_str(),&tm);
50 if (0 != cret && cret <= len) {
55 }
while (0 == ret.size());
57 LOG(
"\tdate=" << ret);
62 LOG(
"posix::check_return " << call <<
" => " << code);
66 LOG(
"\tthrowing " << errno <<
" => " << desc);
73 : fdn(f), dest_close(c)
75 LOG(
"posix::fd (" << f <<
"," << c <<
")");
78 std::streamsize fd::read(
char* buf, std::streamsize len)
80 LOG(
"posix::fd::read " << len);
85 count = ::read(fdn, buf, len);
86 }
while (-1 == count && EINTR == errno);
96 ssize_t count = read(buf, len);
101 std::streamsize fd::write(
const char* buf, std::streamsize len)
103 LOG(
"posix::fd::write " << len);
108 count = ::write(fdn, buf, len);
109 }
while (-1 == count && EINTR == errno);
118 LOG(
"posix::fd::sync");
119 int cret = fsync(fdn);
125 LOG(
"posix::fd::~fd");
debugging/logging support
exceptions related to POSIX systems calls
void check_return(int code, const std::string &call)
checks the return code of a syscall and raises apropriate exception if needed
POSIX helper objects and functions.