17 #if defined(ZTH_HAVE_POLLER) && !defined(ZTH_OS_WINDOWS)
27 ssize_t
read(
int fd,
void* buf,
size_t count)
31 int flags = fcntl(fd, F_GETFL);
36 if((flags & O_NONBLOCK)) {
54 ssize_t
write(
int fd,
void const* buf,
size_t count)
58 int flags = fcntl(fd, F_GETFL);
63 if((flags & O_NONBLOCK)) {
80 static int no_io __attribute__((unused));
Fiber & currentFiber() noexcept
Return the currently executing fiber.
ssize_t read(int fd, void *buf, size_t count)
Like normal read(), but forwards the poll() to the zth::Waiter in case it would block.
ssize_t write(int fd, void const *buf, size_t count)
Like normal write(), but forwards the poll() to the zth::Waiter in case it would block.
int poll(P pollable, int timeout_ms=-1)
Fiber-aware poll() for a single pollable thing.
#define zth_dbg(group, fmt, a...)
Debug printf()-like function.
cow_string str(T value)
Returns an zth::string representation of the given value.
void perf_syscall(char const *syscall, Timestamp const &t=Timestamp())
Put a syscall into the perf output.
A pollable file descriptor.
static const unsigned long PollIn
static const unsigned long PollOut
#define unlikely(expr)
Marks the given expression to likely be evaluated to true.