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
qcore_unix.cpp File Reference

(f96a17225f088a5790655c01eaab9578c81a19f2)

#include <QtCore/private/qglobal_p.h>
#include <QtCore/qbasicatomic.h>
#include "qcore_unix_p.h"
#include <stdlib.h>
+ Include dependency graph for qcore_unix.cpp:

Go to the source code of this file.

Macros

#define PATH_MAX   1024*1024
 

Functions

QT_BEGIN_NAMESPACE void qt_ignore_sigpipe () noexcept
 
QByteArray qt_readlink (const char *path)
 
static int timespecToMillisecs (const struct timespec *ts)
 
int qt_poll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts)
 
static int qt_ppoll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts)
 
int qt_safe_poll (struct pollfd *fds, nfds_t nfds, QDeadlineTimer deadline)
 

Macro Definition Documentation

◆ PATH_MAX

#define PATH_MAX   1024*1024

Function Documentation

◆ qt_ignore_sigpipe()

QT_BEGIN_NAMESPACE void qt_ignore_sigpipe ( )
noexcept

Definition at line 23 of file qcore_unix.cpp.

References Q_BASIC_ATOMIC_INITIALIZER.

Referenced by qt_safe_sendmsg(), and qt_safe_write_nosignal().

+ Here is the caller graph for this function:

◆ 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_ppoll()

static int qt_ppoll ( struct pollfd * fds,
nfds_t nfds,
const struct timespec * timeout_ts )
inlinestatic

Definition at line 100 of file qcore_unix.cpp.

References qt_poll(), and timespecToMillisecs().

Referenced by qt_safe_poll().

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

◆ qt_readlink()

QByteArray qt_readlink ( const char * path)

Definition at line 38 of file qcore_unix.cpp.

References PATH_MAX, QByteArray(), and Qt::Uninitialized.

Referenced by QFileSystemEngine::getLinkTarget(), QFileSystemEngine::getRawLinkPath(), QLockFilePrivate::processNameByPid(), and qAppFileName().

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

◆ qt_safe_poll()

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 121 of file qcore_unix.cpp.

References deadline, durationToTimespec(), QDeadlineTimer::isForever(), QT_EINTR_LOOP, qt_ppoll(), QDeadlineTimer::remainingTimeAsDuration(), and ret.

Referenced by QNativeSocketEnginePrivate::nativeSelect(), and QEventDispatcherUNIX::processEvents().

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

◆ timespecToMillisecs()

static int timespecToMillisecs ( const struct timespec * ts)
inlinestatic

Definition at line 88 of file qcore_unix.cpp.

Referenced by qt_ppoll().

+ Here is the caller graph for this function: