(0a4ddd8126f2092414038ee80b3462a070973327)
#include "qplatformdefs.h"
#include <QtCore/private/qglobal_p.h>
#include "qbytearray.h"
#include "qdeadlinetimer.h"
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/select.h>
#include <sys/time.h>
#include <chrono>
#include <sys/wait.h>
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
Go to the source code of this file.
|
| QT_BEGIN_NAMESPACE | Q_DECLARE_TYPEINFO (pollfd, Q_PRIMITIVE_TYPE) |
| timespec | durationToTimespec (std::chrono::nanoseconds timeout) noexcept |
| template<typename Duration> |
| Duration | timespecToChrono (timespec ts) noexcept |
| constexpr timespec & | normalizedTimespec (timespec &t) |
| timeval | timespecToTimeval (timespec ts) |
| template<clockid_t ClockId = QSteadyClockClockId> |
| timespec | deadlineToAbstime (QDeadlineTimer deadline) |
| Q_CORE_EXPORT void | qt_ignore_sigpipe () noexcept |
| static int | qt_safe_open (const char *pathname, int flags, mode_t mode=0777) |
| static int | qt_safe_pipe (int pipefd[2], int flags=0) |
| static int | qt_safe_dup (int oldfd, int atleast=0, int flags=FD_CLOEXEC) |
| static int | qt_safe_dup2 (int oldfd, int newfd, int flags=FD_CLOEXEC) |
| static qint64 | qt_safe_read (int fd, void *data, qint64 maxlen) |
| static qint64 | qt_safe_write (int fd, const void *data, qint64 len) |
| static qint64 | qt_safe_write_nosignal (int fd, const void *data, qint64 len) |
| static int | qt_safe_close (int fd) |
| QByteArray | qt_readlink (const char *path) |
| bool | qt_haveLinuxProcfs () |
| Q_CORE_EXPORT int | qt_safe_poll (struct pollfd *fds, nfds_t nfds, QDeadlineTimer deadline) |
| static struct pollfd | qt_make_pollfd (int fd, short events) |
◆ _POSIX_MONOTONIC_CLOCK
| #define _POSIX_MONOTONIC_CLOCK -1 |
◆ QT_CLOSE
◆ QT_EINTR_LOOP
| #define QT_EINTR_LOOP |
( |
| var, |
|
|
| cmd ) |
Value:do { \
var = cmd; \
} while (var == -1 && errno == EINTR)
Definition at line 60 of file qcore_unix_p.h.
◆ QT_OPEN
◆ QT_READ
◆ QT_WRITE
◆ deadlineToAbstime()
template<clockid_t ClockId = QSteadyClockClockId>
◆ durationToTimespec()
| timespec durationToTimespec |
( |
std::chrono::nanoseconds | timeout | ) |
|
|
inlinenoexcept |
◆ normalizedTimespec()
| timespec & normalizedTimespec |
( |
timespec & | t | ) |
|
|
inlineconstexpr |
◆ Q_DECLARE_TYPEINFO()
◆ qt_haveLinuxProcfs()
| bool qt_haveLinuxProcfs |
( |
| ) |
|
|
inline |
◆ qt_ignore_sigpipe()
| Q_CORE_EXPORT void qt_ignore_sigpipe |
( |
| ) |
|
|
noexcept |
◆ qt_make_pollfd()
| struct pollfd qt_make_pollfd |
( |
int | fd, |
|
|
short | events ) |
|
inlinestatic |
◆ qt_readlink()
◆ qt_safe_close()
| int qt_safe_close |
( |
int | fd | ) |
|
|
inlinestatic |
◆ qt_safe_dup()
| int qt_safe_dup |
( |
int | oldfd, |
|
|
int | atleast = 0, |
|
|
int | flags = FD_CLOEXEC ) |
|
inlinestatic |
◆ qt_safe_dup2()
| int qt_safe_dup2 |
( |
int | oldfd, |
|
|
int | newfd, |
|
|
int | flags = FD_CLOEXEC ) |
|
inlinestatic |
◆ qt_safe_open()
| int qt_safe_open |
( |
const char * | pathname, |
|
|
int | flags, |
|
|
mode_t | mode = 0777 ) |
|
inlinestatic |
◆ qt_safe_pipe()
| int qt_safe_pipe |
( |
int | pipefd[2], |
|
|
int | flags = 0 ) |
|
inlinestatic |
◆ qt_safe_poll()
| Q_CORE_EXPORT int qt_safe_poll |
( |
struct pollfd * | fds, |
|
|
nfds_t | nfds, |
|
|
QDeadlineTimer | deadline ) |
Behaves as close to POSIX poll(2) as practical but may be implemented using select(2) where necessary. In that case, returns -1 and sets errno to EINVAL if passed any descriptor greater than or equal to FD_SETSIZE.
Definition at line 122 of file qcore_unix.cpp.
References qt_ppoll().
◆ qt_safe_read()
◆ qt_safe_write()
◆ qt_safe_write_nosignal()
◆ timespecToChrono()
template<typename Duration>
| Duration timespecToChrono |
( |
timespec | ts | ) |
|
|
inlinenoexcept |
◆ timespecToTimeval()
| timeval timespecToTimeval |
( |
timespec | ts | ) |
|
|
inline |
◆ OneSecAsNsecs
| auto OneSecAsNsecs = std::chrono::nanoseconds(std::chrono::seconds{ 1 }).count() |
|
staticconstexpr |
◆ QSteadyClockClockId
| clockid_t QSteadyClockClockId |
|
inlinestaticconstexpr |
◆ QWaitConditionClockId
| clockid_t QWaitConditionClockId |
|
inlinestaticconstexpr |