13 while (s == -1 && errno == EINTR);
22 assert(!buffers || into);
31 std::vector<iovec> bufs(buffers);
33 bufs[
i].iov_len = into[
i].
size();
34 bufs[
i].iov_base = (caddr_t)into[
i].
data();
40 while (n == -1 && errno == EINTR);
57 while (s == -1 && errno == EINTR);
59 if (s == -1 && errno != EWOULDBLOCK)
62 return s >= 0 ? s : 0;
66 assert(!buffers || from);
75 std::vector<iovec> bufs(buffers);
77 bufs[
i].iov_len = from[
i].
size();
78 bufs[
i].iov_base = (caddr_t)from[
i].
data();
84 while (n == -1 && errno == EINTR);
100 int off = value ? ~0 : ~(O_NDELAY |
O_NONBLOCK);
103 if ((mode = fcntl(
fd(), F_GETFL, 0)) == -1 || fcntl(
fd(), F_SETFL, (mode & off) | on) == -1)
104 throwStorageError(
"FileSetBlockingError",
"Calling IOChannel::setBlocking()",
"fcntl()", errno);
105 #elif defined FIONBIO 107 if (ioctl(
fd(), FIONBIO, &value) == -1)
108 throwStorageError(
"FileSetBlockingError",
"Calling IOChannel::setBlocking()",
"ioctl()", errno);
115 if ((mode = fcntl(
fd(), F_GETFL, 0)) == -1)
116 throwStorageError(
"FileIsBlockingError",
"Calling IOChannel::isBlocking()",
"fcntl()", errno);
119 #else // ! O_NONBLOCK
void throwStorageError(const char *category, const char *context, const char *call, int error)
ret
prodAgent to be discontinued
IOSize writev(const IOBuffer *from, IOSize buffers) override
IOSize readv(IOBuffer *into, IOSize buffers) override
IOSize write(const void *from, IOSize n) override
virtual void setBlocking(bool value)
char data[epos_bytes_allocation]
virtual bool isBlocking(void) const
bool sysclose(IOFD fd, int *error=nullptr)
virtual IOFD fd(void) const