30 constexpr
int eintr_maximum_attempts =100;
31 #define HANDLE_EINTR_EAGAIN(x) ({ \
32 unsigned char _attempts = 0; \
34 decltype(x) _result; \
40 while (_result == -1 \
41 && (errno == EINTR || \
43 errno == EWOULDBLOCK) \
44 && _attempts++ < eintr_maximum_attempts); \
49 constexpr
int PIPE_LISTEN = 0, PIPE_WRITE = 1;
50 typedef void (*PipeSourceCallback)(
void* ctx);
63 GSource*
pipe_source_new(
int pipefd[2], PipeSourceCallback cb,
void* ctx);
65 #endif // GLIB_TOOLS_H