7#include <rtems/rtems_bsdnet_internal.h>
12#define QT_POLL_READ_MASK (POLLIN | POLLRDNORM)
13#define QT_POLL_WRITE_MASK (POLLOUT | POLLWRNORM | POLLWRBAND)
14#define QT_POLL_EXCEPT_MASK (POLLPRI | POLLRDBAND)
15#define QT_POLL_ERROR_MASK (POLLERR | POLLNVAL)
16#define QT_POLL_EVENTS_MASK (QT_POLL_READ_MASK | QT_POLL_WRITE_MASK | QT_POLL_EXCEPT_MASK)
19 fd_set *read_fds, fd_set *write_fds, fd_set *except_fds)
27 for (nfds_t
i = 0;
i < nfds;
i++) {
28 if (
fds[
i].
fd >= FD_SETSIZE) {
37 FD_SET(
fds[
i].
fd, read_fds);
40 FD_SET(
fds[
i].
fd, write_fds);
43 FD_SET(
fds[
i].
fd, except_fds);
58 const int error = (
res < 0) ? errno : 0;
61 pfd.revents |= POLLHUP;
62 }
else if (
res > 0 ||
error == ENOTSOCK ||
error == ENOTCONN) {
70 pfd.revents |= POLLHUP;
73 pfd.revents |= POLLERR;
80 fd_set *read_fds, fd_set *write_fds, fd_set *except_fds)
84 for (nfds_t
i = 0;
i < nfds;
i++) {
88 if (FD_ISSET(
fds[
i].
fd, read_fds))
91 if (FD_ISSET(
fds[
i].
fd, write_fds))
94 if (FD_ISSET(
fds[
i].
fd, except_fds))
97 if (
fds[
i].revents != 0)
107 if (!rtems_bsdnet_fdToSocket(
fd))
113 return (
ret == -1 && errno == EBADF);
120 for (nfds_t
i = 0;
i < nfds;
i++) {
128 fds[
i].revents |= POLLNVAL;
136int qt_poll(
struct pollfd *
fds, nfds_t nfds,
const struct timespec *timeout_ts)
143 fd_set read_fds, write_fds, except_fds;
144 struct timeval tv, *ptv =
nullptr;
153 for (nfds_t
i = 0;
i < nfds;
i++) {
159 if (
fds[
i].
fd > FD_SETSIZE) {
171 fds[
i].revents = POLLNVAL;
188 const int ret =
::select(max_fd, &read_fds, &write_fds, &except_fds, ptv);
EGLint EGLint EGLint EGLint int int int int * fds
Combined button and popup list for selecting options.
timeval timespecToTimeval(timespec ts)
#define EINTR_LOOP(var, cmd)
DBusConnection const char DBusError * error
constexpr const T & qMax(const T &a, const T &b)
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
int qt_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts)
static int qt_poll_prepare(struct pollfd *fds, nfds_t nfds, fd_set *read_fds, fd_set *write_fds, fd_set *except_fds)
static void qt_poll_examine_ready_read(struct pollfd &pfd)
#define QT_POLL_READ_MASK
#define QT_POLL_ERROR_MASK
#define QT_POLL_EVENTS_MASK
#define QT_POLL_EXCEPT_MASK
static int qt_poll_mark_bad_fds(struct pollfd *fds, const nfds_t nfds)
static int qt_poll_sweep(struct pollfd *fds, nfds_t nfds, fd_set *read_fds, fd_set *write_fds, fd_set *except_fds)
static bool qt_poll_is_bad_fd(int fd)
#define QT_POLL_WRITE_MASK
selection select(topLeft, bottomRight)