Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qpoll.cpp File Reference

(f96a17225f088a5790655c01eaab9578c81a19f2)

#include "qcore_unix_p.h"
+ Include dependency graph for qpoll.cpp:

Go to the source code of this file.

Macros

#define QT_POLL_READ_MASK   (POLLIN | POLLRDNORM)
 
#define QT_POLL_WRITE_MASK   (POLLOUT | POLLWRNORM | POLLWRBAND)
 
#define QT_POLL_EXCEPT_MASK   (POLLPRI | POLLRDBAND)
 
#define QT_POLL_ERROR_MASK   (POLLERR | POLLNVAL)
 
#define QT_POLL_EVENTS_MASK   (QT_POLL_READ_MASK | QT_POLL_WRITE_MASK | QT_POLL_EXCEPT_MASK)
 

Functions

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)
 
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)
 
static int qt_poll_mark_bad_fds (struct pollfd *fds, const nfds_t nfds)
 
int qt_poll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts)
 

Macro Definition Documentation

◆ QT_POLL_ERROR_MASK

#define QT_POLL_ERROR_MASK   (POLLERR | POLLNVAL)

Definition at line 15 of file qpoll.cpp.

Referenced by qt_poll_mark_bad_fds(), and qt_poll_prepare().

◆ QT_POLL_EVENTS_MASK

#define QT_POLL_EVENTS_MASK   (QT_POLL_READ_MASK | QT_POLL_WRITE_MASK | QT_POLL_EXCEPT_MASK)

Definition at line 16 of file qpoll.cpp.

Referenced by qt_poll(), and qt_poll_prepare().

◆ QT_POLL_EXCEPT_MASK

#define QT_POLL_EXCEPT_MASK   (POLLPRI | POLLRDBAND)

Definition at line 14 of file qpoll.cpp.

Referenced by qt_poll_prepare(), and qt_poll_sweep().

◆ QT_POLL_READ_MASK

#define QT_POLL_READ_MASK   (POLLIN | POLLRDNORM)

Definition at line 12 of file qpoll.cpp.

Referenced by qt_poll_examine_ready_read(), and qt_poll_prepare().

◆ QT_POLL_WRITE_MASK

#define QT_POLL_WRITE_MASK   (POLLOUT | POLLWRNORM | POLLWRBAND)

Definition at line 13 of file qpoll.cpp.

Referenced by qt_poll_prepare(), and qt_poll_sweep().

Function Documentation

◆ qt_poll()

int qt_poll ( struct pollfd * fds,
nfds_t nfds,
const struct timespec * timeout_ts )

Definition at line 136 of file qpoll.cpp.

References forever, i, QT_POLL_EVENTS_MASK, qt_poll_is_bad_fd(), qt_poll_mark_bad_fds(), qt_poll_prepare(), qt_poll_sweep(), ret, select(), and timespecToTimeval().

Referenced by qt_ppoll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_poll_examine_ready_read()

static void qt_poll_examine_ready_read ( struct pollfd & pfd)
inlinestatic

Definition at line 52 of file qpoll.cpp.

References error, QT_EINTR_LOOP, and QT_POLL_READ_MASK.

Referenced by qt_poll_sweep().

+ Here is the caller graph for this function:

◆ qt_poll_is_bad_fd()

static bool qt_poll_is_bad_fd ( int fd)
inlinestatic

Definition at line 104 of file qpoll.cpp.

References QT_EINTR_LOOP, and ret.

Referenced by qt_poll(), and qt_poll_mark_bad_fds().

+ Here is the caller graph for this function:

◆ qt_poll_mark_bad_fds()

static int qt_poll_mark_bad_fds ( struct pollfd * fds,
const nfds_t nfds )
inlinestatic

Definition at line 116 of file qpoll.cpp.

References i, QT_POLL_ERROR_MASK, and qt_poll_is_bad_fd().

Referenced by qt_poll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_poll_prepare()

static int qt_poll_prepare ( struct pollfd * fds,
nfds_t nfds,
fd_set * read_fds,
fd_set * write_fds,
fd_set * except_fds )
inlinestatic

Definition at line 18 of file qpoll.cpp.

References i, qMax(), QT_POLL_ERROR_MASK, QT_POLL_EVENTS_MASK, QT_POLL_EXCEPT_MASK, QT_POLL_READ_MASK, and QT_POLL_WRITE_MASK.

Referenced by qt_poll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_poll_sweep()

static int qt_poll_sweep ( struct pollfd * fds,
nfds_t nfds,
fd_set * read_fds,
fd_set * write_fds,
fd_set * except_fds )
inlinestatic

Definition at line 79 of file qpoll.cpp.

References i, qt_poll_examine_ready_read(), QT_POLL_EXCEPT_MASK, and QT_POLL_WRITE_MASK.

Referenced by qt_poll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: