return true;
}
+bool
+ply_fd_has_data (int fd)
+{
+ struct pollfd poll_data;
+ int result;
+
+ poll_data.fd = fd;
+ poll_data.events = POLLIN | POLLPRI;
+ poll_data.revents = 0;
+ result = poll (&poll_data, 1, 10);
+
+ return result == 1
+ && ((poll_data.revents & POLLIN)
+ || (poll_data.revents & POLLPRI));
+}
+
+bool
+ply_fd_can_take_data (int fd)
+{
+ struct pollfd poll_data;
+ int result;
+
+ poll_data.fd = fd;
+ poll_data.events = POLLOUT;
+ poll_data.revents = 0;
+ result = poll (&poll_data, 1, 10);
+
+ return result == 1;
+}
+
bool
ply_fd_may_block (int fd)
{
uint32_t *value);
bool ply_fd_has_data (int fd);
+bool ply_fd_can_take_data (int fd);
+bool ply_fd_may_block (int fd);
bool ply_set_fd_as_blocking (int fd);
char **ply_copy_string_array (const char *const *array);
void ply_free_string_array (char **array);