48 if (!
SetFd(::open(fname, flags))) {
50 string(
"open() for '") + fname +
"' failed: ", errno);
61 if (!
SetFd(::open(fname, flags, mode))) {
63 string(
"open() for '") + fname +
"' failed: ", errno);
73 if (::fstat(
fFd, sbuf) < 0) {
85 if (::lseek(
fFd, offset, whence) < 0) {
97 if (::ftruncate(
fFd, length) < 0) {
109 ssize_t irc = ::read(
fFd, buf, count);
121 ssize_t irc = ::write(
fFd, buf, count);
122 if (irc < ssize_t(count)) {
123 emsg.
InitErrno(
"WriteAll()",
"write() failed: ", errno);
void InitErrno(const std::string &meth, const std::string &text, int errnum)
FIXME_docs.
bool IsOpen() const
FIXME_docs.
bool SetFd(int fd)
FIXME_docs.
bool WriteAll(const void *buf, size_t count, RerrMsg &emsg)
FIXME_docs.
ssize_t Read(void *buf, size_t count, RerrMsg &emsg)
FIXME_docs.
bool Stat(struct stat *sbuf, RerrMsg &emsg)
FIXME_docs.
off_t Seek(off_t offset, int whence, RerrMsg &emsg)
FIXME_docs.
bool Open(const char *fname, int flags, RerrMsg &emsg)
FIXME_docs.
bool Truncate(off_t length, RerrMsg &emsg)
FIXME_docs.
Declaration of class ReventLoop.