8#include <private/qdebug_p.h>
9#include "qplatformdefs.h"
14#include "private/qcore_unix_p.h"
15#include "private/qlocking_p.h"
18#include <private/qcore_mac_p.h>
21#include <private/qcoreapplication_p.h>
22#include <private/qthread_p.h>
32# include <sys/neutrino.h>
39#include <sys/resource.h>
43#if __has_include(<paths.h>)
46#if __has_include(<linux/close_range.h>)
48# include <linux/close_range.h>
59# define _PATH_DEV "/dev/"
62# define _PATH_TTY _PATH_DEV "tty"
74#if !defined(Q_OS_DARWIN)
97namespace QtVforkSafe {
118# define LIBC_PREFIX __libc_
119#elif defined(Q_OS_FREEBSD)
121# define LIBC_PREFIX _
125# define CONCAT(x, y) CONCAT2(x, y)
126# define CONCAT2(x, y) x ## y
127# define DECLARE_FUNCTIONS(NAME) \
128 extern decltype(::NAME) CONCAT(LIBC_PREFIX, NAME); \
129 static constexpr auto NAME = std::addressof(CONCAT(LIBC_PREFIX, NAME));
131# define DECLARE_FUNCTIONS(NAME) using ::NAME;
135DECLARE_FUNCTIONS(sigaction)
139#undef DECLARE_FUNCTIONS
142static void change_sigpipe(
decltype(SIG_DFL) new_handler)
145 memset(&sa, 0,
sizeof(sa));
146 sa.sa_handler = new_handler;
147 sigaction(SIGPIPE, &sa,
nullptr);
156 if (encodedName !=
"/" && !encodedName.endsWith(
"/."))
164 int pipe[2] = { -1, -1 };
165 AutoPipe(
int flags = 0)
171 for (
int fd : pipe) {
177 explicit operator bool()
const {
return pipe[0] >= 0; }
178 int &operator[](
int idx) {
return pipe[idx]; }
179 int operator[](
int idx)
const {
return pipe[idx]; }
185 char function[_POSIX_PIPE_BUF -
sizeof(
code)];
187static_assert(std::is_trivial_v<ChildError>);
189static_assert(PIPE_BUF >=
sizeof(ChildError));
194 QProcessPoller(
const QProcessPrivate &proc);
198 pollfd &stdinPipe() {
return pfds[0]; }
199 pollfd &stdoutPipe() {
return pfds[1]; }
200 pollfd &stderrPipe() {
return pfds[2]; }
201 pollfd &forkfd() {
return pfds[3]; }
207QProcessPoller::QProcessPoller(
const QProcessPrivate &proc)
209 for (
int i = 0;
i < n_pfds;
i++)
212 stdoutPipe().fd = proc.stdoutChannel.pipe[0];
213 stderrPipe().fd = proc.stderrChannel.pipe[0];
215 if (!proc.writeBuffer.isEmpty()) {
216 stdinPipe().fd = proc.stdinChannel.pipe[1];
217 stdinPipe().events = POLLOUT;
220 forkfd().fd = proc.forkfd;
231 struct CharPointerList
233 std::unique_ptr<char *[]> pointers;
237 operator char **()
const {
return pointers.get(); }
244 const QProcessPrivate *
d;
245 CharPointerList argv;
246 CharPointerList envp;
248 int workingDirectory = -2;
249 bool isUsingVfork = usingVfork();
253 return workingDirectory != -1;
256 QChildProcess(QProcessPrivate *
d)
258 envp(
d->environmentPrivate())
270 disableThreadCancellations();
272 if (!
d->workingDirectory.isEmpty()) {
274 if (workingDirectory < 0) {
275 d->setErrorAndEmit(QProcess::FailedToStart,
"chdir: "_L1 +
qt_error_string());
281 ~QChildProcess() noexcept(
false)
283 if (workingDirectory >= 0)
284 close(workingDirectory);
286 restoreThreadCancellations();
290 void maybeBlockSignals() noexcept
297 sigfillset(&emptyset);
298 pthread_sigmask(SIG_SETMASK, &emptyset, &oldsigset);
302 void restoreSignalMask() const noexcept
305 pthread_sigmask(SIG_SETMASK, &oldsigset,
nullptr);
308 bool usingVfork() const noexcept;
310 template <typename Lambda>
int doFork(Lambda &&childLambda)
319 _exit(childLambda());
323 int startChild(pid_t *pid)
325 int ffdflags = FFD_CLOEXEC | (isUsingVfork ? 0 : FFD_USE_FORK);
326 return ::vforkfd(ffdflags, pid, &QChildProcess::startProcess,
this);
334 Q_UNREACHABLE_RETURN(-1);
337#if defined(PTHREAD_CANCEL_DISABLE)
339 void disableThreadCancellations() noexcept
342 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldstate);
344 void restoreThreadCancellations() noexcept(
false)
347 pthread_setcancelstate(oldstate,
nullptr);
350 void disableThreadCancellations() noexcept {}
351 void restoreThreadCancellations() {}
360 pointers.reset(
new char *[
count + 1]);
361 pointers[
count] =
nullptr;
365 pointers[0] =
reinterpret_cast<char *
>(0);
372 pointers[
i] =
reinterpret_cast<char *
>(
data.size());
377 updatePointers(
count);
387 pointers.reset(
new char *[
count + 1]);
388 pointers[
count] =
nullptr;
390 const auto end = env.
end();
395 pointers[
i] =
reinterpret_cast<char *
>(
data.size());
403 updatePointers(
count);
406void QChildProcess::CharPointerList::updatePointers(
qsizetype count)
408 char *
const base =
const_cast<char *
>(
data.constBegin());
414static bool qt_pollfd_check(
const pollfd &pfd,
short revents)
416 return pfd.fd >= 0 && (pfd.revents & (revents | POLLHUP | POLLERR | POLLNVAL)) != 0;
419static int qt_create_pipe(
int *pipe)
433void QProcessPrivate::destroyPipe(
int *pipe)
445void QProcessPrivate::closeChannel(Channel *
channel)
453void QProcessPrivate::cleanup()
455 q_func()->setProcessState(QProcess::NotRunning);
458 delete stateNotifier;
459 stateNotifier =
nullptr;
460 destroyPipe(childStartedPipe);
471bool QProcessPrivate::openChannel(Channel &
channel)
475 if (
channel.type == Channel::Normal) {
477 if (qt_create_pipe(
channel.pipe) != 0) {
478 setErrorAndEmit(QProcess::FailedToStart,
"pipe: "_L1 +
qt_error_string(errno));
483 if (threadData.loadRelaxed()->hasEventDispatcher()) {
484 if (&
channel == &stdinChannel) {
488 q,
SLOT(_q_canWrite()));
492 const char *receiver;
493 if (&
channel == &stdoutChannel)
494 receiver =
SLOT(_q_canReadStandardOutput());
496 receiver =
SLOT(_q_canReadStandardError());
503 }
else if (
channel.type == Channel::Redirect) {
507 if (&
channel == &stdinChannel) {
512 setErrorAndEmit(QProcess::FailedToStart,
513 QProcess::tr(
"Could not open input redirection for reading"));
515 int mode = O_WRONLY | O_CREAT;
525 setErrorAndEmit(QProcess::FailedToStart,
526 QProcess::tr(
"Could not open input redirection for reading"));
535 if (
channel.type == Channel::PipeSource) {
558 Q_PIPE pipe[2] = { -1, -1 };
559 if (qt_create_pipe(pipe) != 0) {
560 setErrorAndEmit(QProcess::FailedToStart,
"pipe: "_L1 +
qt_error_string(errno));
563 sink->pipe[0] = pipe[0];
564 source->pipe[1] = pipe[1];
571void QProcessPrivate::commitChannels()
const
584 if (processChannelMode == QProcess::MergedChannels)
594 if (
program.endsWith(
".app"_L1) && fileInfo.isDir()) {
595 QCFType<CFURLRef>
url = CFURLCreateWithFileSystemPath(0,
597 kCFURLPOSIXPathStyle,
true);
603 QCFType<CFBundleRef> bundle = CFBundleCreate(0,
url);
605 QCFType<CFURLRef> executableURL = CFBundleCopyExecutableURL(bundle);
607 url = CFURLCopyAbsoluteURL(executableURL);
610 const QCFString str = CFURLCopyFileSystemPath(
url, kCFURLPOSIXPathStyle);
611 return QString::fromCFString(
str);
629inline bool globalUsingVfork() noexcept
631#if defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer)
635#if defined(__SANITIZE_THREAD__) || __has_feature(thread_sanitizer)
639#if defined(Q_OS_LINUX) && !QT_CONFIG(forkfd_pidfd)
645#if defined(Q_OS_DARWIN)
654 return __interceptor_vfork ==
nullptr;
657inline bool QChildProcess::usingVfork() const noexcept
659 if (!globalUsingVfork())
662 if (!
d->unixExtras || !
d->unixExtras->childProcessModifier)
667 auto flags =
d->unixExtras->processParameters.flags;
668 return flags.testFlag(QProcess::UnixProcessFlag::UseVFork);
671#ifdef QT_BUILD_INTERNAL
674 return globalUsingVfork();
678void QProcessPrivate::startProcess()
681 q->setProcessState(QProcess::Starting);
683#if defined (QPROCESS_DEBUG)
684 qDebug(
"QProcessPrivate::startProcess()");
688 if (!openChannels()) {
694 if (qt_create_pipe(childStartedPipe) != 0) {
695 setErrorAndEmit(QProcess::FailedToStart,
"pipe: "_L1 +
qt_error_string(errno));
700 if (threadData.loadRelaxed()->hasEventDispatcher()) {
707 q,
SLOT(_q_startupNotification()));
711 QChildProcess childProcess(
this);
712 if (!childProcess.ok()) {
713 Q_ASSERT(processError != QProcess::UnknownError);
718 forkfd = childProcess.startChild(&pid);
719 int lastForkErrno = errno;
723#if defined (QPROCESS_DEBUG)
726 q->setProcessState(QProcess::NotRunning);
727 setErrorAndEmit(QProcess::FailedToStart,
728 QProcess::tr(
"Resource error (fork failure): %1").
arg(
qt_error_string(lastForkErrno)));
738 childStartedPipe[1] = -1;
740 if (stdinChannel.pipe[0] != -1) {
742 stdinChannel.pipe[0] = -1;
745 if (stdinChannel.pipe[1] != -1)
746 ::fcntl(stdinChannel.pipe[1], F_SETFL, ::fcntl(stdinChannel.pipe[1], F_GETFL) | O_NONBLOCK);
748 if (stdoutChannel.pipe[1] != -1) {
750 stdoutChannel.pipe[1] = -1;
753 if (stdoutChannel.pipe[0] != -1)
754 ::fcntl(stdoutChannel.pipe[0], F_SETFL, ::fcntl(stdoutChannel.pipe[0], F_GETFL) | O_NONBLOCK);
756 if (stderrChannel.pipe[1] != -1) {
758 stderrChannel.pipe[1] = -1;
760 if (stderrChannel.pipe[0] != -1)
761 ::fcntl(stderrChannel.pipe[0], F_SETFL, ::fcntl(stderrChannel.pipe[0], F_GETFL) | O_NONBLOCK);
766static constexpr int FakeErrnoForThrow = std::numeric_limits<int>::max();
768static QString startFailureErrorMessage(ChildError &err, [[maybe_unused]] ssize_t bytesRead)
776 if (err.code == FakeErrnoForThrow)
777 return QProcess::tr(
"Child process modifier threw an exception: %1")
778 .arg(std::move(complement));
780 return QProcess::tr(
"Child process modifier reported error: %1")
781 .arg(std::move(complement));
783 return QProcess::tr(
"Child process modifier reported error: %1: %2")
785 return QProcess::tr(
"Child process set up failed: %1: %2")
790failChildProcess(
const QProcessPrivate *
d,
const char *description,
int code)
noexcept
792 ChildError
error = {};
799void QProcess::failChildProcessModifier(
const char *description,
int error)
noexcept
802 failChildProcess(d_func(), description, -
error);
806static const char *applyProcessParameters(
const QProcess::UnixProcessParameters &
params)
810 bool ignore_sigpipe =
params.flags.testFlag(QProcess::UnixProcessFlag::IgnoreSigPipe);
812 QtVforkSafe::change_sigpipe(SIG_IGN);
813 if (
params.flags.testFlag(QProcess::UnixProcessFlag::ResetSignalHandlers)) {
814 struct sigaction sa = {};
815 sa.sa_handler = SIG_DFL;
816 for (
int sig = 1; sig < NSIG; ++sig) {
817 if (!ignore_sigpipe || sig != SIGPIPE)
818 QtVforkSafe::sigaction(sig, &sa,
nullptr);
824 sigprocmask(SIG_SETMASK, &
set,
nullptr);
829 if (
params.flags.testFlag(QProcess::UnixProcessFlag::CloseFileDescriptors)) {
831 int fd =
qMax(STDERR_FILENO + 1,
params.lowestFileDescriptorToClose);
832#if QT_CONFIG(close_range)
835 r = close_range(
fd, INT_MAX, 0);
842 int max_fd = INT_MAX;
843 if (
struct rlimit
limit; getrlimit(RLIMIT_NOFILE, &
limit) == 0)
844 max_fd =
limit.rlim_cur;
845 for ( ;
fd < max_fd; ++
fd)
851 if (
params.flags.testFlag(QProcess::UnixProcessFlag::CreateNewSession)) {
858 if (
params.flags.testFlag(QProcess::UnixProcessFlag::DisconnectControllingTerminal)) {
861 int r = ioctl(
fd, TIOCNOTTY);
862 int savedErrno = errno;
874 if (
params.flags.testFlag(QProcess::UnixProcessFlag::ResetIds)) {
875 int r = setgid(getgid());
876 r = setuid(getuid());
884static void callChildProcessModifier(
const QProcessPrivate *
d)
noexcept
887 if (
d->unixExtras->childProcessModifier)
888 d->unixExtras->childProcessModifier();
890 failChildProcess(
d, e.what(), FakeErrnoForThrow);
892 failChildProcess(
d,
"throw", FakeErrnoForThrow);
901void QChildProcess::startProcess() const noexcept
910 if (workingDirectory >= 0 && fchdir(workingDirectory) == -1)
911 failChildProcess(
d,
"fchdir", errno);
913 bool sigpipeHandled =
false;
914 bool sigmaskHandled =
false;
918 callChildProcessModifier(
d);
921 if (
const char *what = applyProcessParameters(
d->unixExtras->processParameters))
922 failChildProcess(
d, what, errno);
924 auto flags =
d->unixExtras->processParameters.flags;
925 using P = QProcess::UnixProcessFlag;
926 sigpipeHandled =
flags.testAnyFlags(P::ResetSignalHandlers | P::IgnoreSigPipe);
927 sigmaskHandled =
flags.testFlag(P::ResetSignalHandlers);
929 if (!sigpipeHandled) {
931 QtVforkSafe::change_sigpipe(SIG_DFL);
933 if (!sigmaskHandled) {
941 qt_safe_execv(argv[0], argv);
943 qt_safe_execve(argv[0], argv, envp);
944 failChildProcess(
d,
"execve", errno);
955 stateNotifier->setEnabled(
false);
956 stateNotifier->disconnect(
q);
959 childStartedPipe[0] = -1;
961#if defined (QPROCESS_DEBUG)
962 qDebug(
"QProcessPrivate::processStarted() == %s",
ret <= 0 ?
"true" :
"false");
968 q,
SLOT(_q_processDied()));
969 stateNotifier->setSocket(forkfd);
970 stateNotifier->setEnabled(
true);
972 if (stdoutChannel.notifier)
973 stdoutChannel.notifier->setEnabled(
true);
974 if (stderrChannel.notifier)
975 stderrChannel.notifier->setEnabled(
true);
987qint64 QProcessPrivate::bytesAvailableInChannel(
const Channel *
channel)
const
992 if (::ioctl(
channel->pipe[0], FIONREAD, (
char *) &nbytes) >= 0)
993 available = (
qint64) nbytes;
994#if defined (QPROCESS_DEBUG)
995 qDebug(
"QProcessPrivate::bytesAvailableInChannel(%d) == %lld",
int(
channel - &stdinChannel), available);
1004#if defined QPROCESS_DEBUG
1005 int save_errno = errno;
1006 qDebug(
"QProcessPrivate::readFromChannel(%d, %p \"%s\", %lld) == %lld",
1011 if (bytesRead == -1 && errno == EWOULDBLOCK)
1022 if (
d->stdinChannel.closed) {
1023#if defined QPROCESS_DEBUG
1024 qDebug(
"QProcess::writeData(%p \"%s\", %lld) == 0 (write channel closing)",
1031 if (
d->stdinChannel.notifier)
1032 d->stdinChannel.notifier->setEnabled(
true);
1034#if defined QPROCESS_DEBUG
1035 qDebug(
"QProcess::writeData(%p \"%s\", %lld) == %lld (written to buffer)",
1041bool QProcessPrivate::_q_canWrite()
1044 if (stdinChannel.notifier)
1045 stdinChannel.notifier->setEnabled(
false);
1046#if defined QPROCESS_DEBUG
1047 qDebug(
"QProcessPrivate::canWrite(), not writing anything (empty write buffer).");
1052 const bool writeSucceeded = writeToStdin();
1055 closeWriteChannel();
1056 else if (stdinChannel.notifier)
1057 stdinChannel.notifier->setEnabled(!
writeBuffer.isEmpty());
1059 return writeSucceeded;
1062bool QProcessPrivate::writeToStdin()
1068#if defined QPROCESS_DEBUG
1069 qDebug(
"QProcessPrivate::writeToStdin(), write(%p \"%s\", %lld) == %lld",
data,
1074 if (written == -1) {
1078 if (errno == EAGAIN)
1081 closeChannel(&stdinChannel);
1082 setErrorAndEmit(QProcess::WriteError);
1086 if (!emittedBytesWritten && written != 0) {
1087 emittedBytesWritten =
true;
1088 emit q_func()->bytesWritten(written);
1089 emittedBytesWritten =
false;
1094void QProcessPrivate::terminateProcess()
1096#if defined (QPROCESS_DEBUG)
1097 qDebug(
"QProcessPrivate::terminateProcess() pid=%jd", intmax_t(pid));
1100 ::kill(pid, SIGTERM);
1103void QProcessPrivate::killProcess()
1105#if defined (QPROCESS_DEBUG)
1106 qDebug(
"QProcessPrivate::killProcess() pid=%jd", intmax_t(pid));
1109 ::kill(pid, SIGKILL);
1114#if defined (QPROCESS_DEBUG)
1116 qDebug(
"QProcessPrivate::waitForStarted(%lld) waiting for child to start (fd = %d)",
1117 msecs, childStartedPipe[0]);
1124#if defined (QPROCESS_DEBUG)
1125 qDebug(
"QProcessPrivate::waitForStarted(%lld) == false (timed out)", msecs);
1130 bool startedEmitted = _q_startupNotification();
1131#if defined (QPROCESS_DEBUG)
1132 qDebug(
"QProcessPrivate::waitForStarted() == %s", startedEmitted ?
"true" :
"false");
1134 return startedEmitted;
1139#if defined (QPROCESS_DEBUG)
1144 QProcessPoller poller(*
this);
1158 bool readyReadEmitted =
false;
1159 if (qt_pollfd_check(poller.stdoutPipe(), POLLIN) && _q_canReadStandardOutput())
1160 readyReadEmitted =
true;
1161 if (qt_pollfd_check(poller.stderrPipe(), POLLIN) && _q_canReadStandardError())
1162 readyReadEmitted =
true;
1164 if (readyReadEmitted)
1167 if (qt_pollfd_check(poller.stdinPipe(), POLLOUT))
1171 if (processState == QProcess::NotRunning)
1176 if (qt_pollfd_check(poller.forkfd(), POLLIN)) {
1186#if defined (QPROCESS_DEBUG)
1191 QProcessPoller poller(*
this);
1204 if (qt_pollfd_check(poller.stdinPipe(), POLLOUT))
1205 return _q_canWrite();
1207 if (qt_pollfd_check(poller.stdoutPipe(), POLLIN))
1208 _q_canReadStandardOutput();
1210 if (qt_pollfd_check(poller.stderrPipe(), POLLIN))
1211 _q_canReadStandardError();
1214 if (processState == QProcess::NotRunning)
1217 if (qt_pollfd_check(poller.forkfd(), POLLIN)) {
1228#if defined (QPROCESS_DEBUG)
1233 QProcessPoller poller(*
this);
1245 if (qt_pollfd_check(poller.stdinPipe(), POLLOUT))
1248 if (qt_pollfd_check(poller.stdoutPipe(), POLLIN))
1249 _q_canReadStandardOutput();
1251 if (qt_pollfd_check(poller.stderrPipe(), POLLIN))
1252 _q_canReadStandardError();
1255 if (processState == QProcess::NotRunning)
1258 if (qt_pollfd_check(poller.forkfd(), POLLIN)) {
1266void QProcessPrivate::waitForDeadChild()
1271 forkfd_info
info = {};
1276 exitCode =
info.status;
1277 exitStatus =
info.code == CLD_EXITED ? QProcess::NormalExit : QProcess::CrashExit;
1279 delete stateNotifier;
1280 stateNotifier =
nullptr;
1285#if defined QPROCESS_DEBUG
1286 qDebug() <<
"QProcessPrivate::waitForDeadChild() dead with exitCode"
1287 << exitCode <<
", crashed?" << (
info.code != CLD_EXITED);
1291bool QProcessPrivate::startDetached(
qint64 *pid)
1293 AutoPipe startedPipe, pidPipe;
1294 if (!startedPipe || !pidPipe) {
1295 setErrorAndEmit(QProcess::FailedToStart,
"pipe: "_L1 +
qt_error_string(errno));
1299 if (!openChannelsForDetached()) {
1306 QChildProcess childProcess(
this);
1307 if (!childProcess.ok()) {
1308 Q_ASSERT(processError != QProcess::UnknownError);
1312 childStartedPipe[1] = startedPipe[1];
1313 pid_t childPid = childProcess.doFork([&] {
1319 pid_t doubleForkPid;
1320 if (childProcess.startChild(&doubleForkPid) == -1)
1321 failChildProcess(
this,
"fork", errno);
1327 childStartedPipe[1] = -1;
1329 int savedErrno = errno;
1332 if (childPid == -1) {
1333 setErrorAndEmit(QProcess::FailedToStart,
"fork: "_L1 +
qt_error_string(savedErrno));
1340 pidPipe[1] = startedPipe[1] = -1;
1347 ChildError childStatus;
1348 ssize_t startResult =
qt_safe_read(startedPipe[0], &childStatus,
sizeof(childStatus));
1352 qt_safe_waitpid(childPid, &
result, 0);
1354 bool success = (startResult == 0);
1355 if (success && pid) {
1357 if (
qt_safe_read(pidPipe[0], &actualPid,
sizeof(pid_t)) !=
sizeof(pid_t))
1360 }
else if (!success) {
1363 setErrorAndEmit(QProcess::FailedToStart,
1364 startFailureErrorMessage(childStatus, startResult));
struct capHdr __attribute__
IOBluetoothL2CAPChannel * channel
qint64 remainingTime() const noexcept
Returns the remaining time in this QDeadlineTimer object in milliseconds.
static QByteArray encodeName(const QString &fileName)
Converts fileName to an 8-bit encoding that you can use in native APIs.
qsizetype size() const noexcept
iterator insert(const Key &key, const T &value)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static QProcessEnvironment systemEnvironment()
static QString findExecutable(const QString &executableName, const QStringList &paths=QStringList())
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QSet< QString >::iterator it
QList< QVariant > arguments
void qErrnoWarning(const char *msg,...)
Combined button and popup list for selecting options.
Lock qt_scoped_lock(Mutex &mutex)
Q_CORE_EXPORT QByteArray toPrintable(const char *data, qint64 len, qsizetype maxSize)
Q_CORE_EXPORT char * qstrncpy(char *dst, const char *src, size_t len)
size_t qstrnlen(const char *str, size_t maxlen)
#define QT_IGNORE_DEPRECATIONS(statement)
int qt_safe_poll(struct pollfd *fds, nfds_t nfds, QDeadlineTimer deadline)
static qint64 qt_safe_write(int fd, const void *data, qint64 len)
static int qt_safe_open(const char *pathname, int flags, mode_t mode=0777)
#define QT_EINTR_LOOP(var, cmd)
static qint64 qt_safe_read(int fd, void *data, qint64 maxlen)
static struct pollfd qt_make_pollfd(int fd, short events)
static int qt_safe_dup2(int oldfd, int newfd, int flags=FD_CLOEXEC)
static int qt_safe_close(int fd)
static qint64 qt_safe_write_nosignal(int fd, const void *data, qint64 len)
static int qt_safe_pipe(int pipefd[2], int flags=0)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
DBusConnection const char DBusError * error
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
Q_DECL_COLD_FUNCTION Q_CORE_EXPORT QString qt_error_string(int errorCode=-1)
constexpr const T & qMax(const T &a, const T &b)
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLsizei GLchar * source
GLdouble GLdouble GLdouble GLdouble q
GLsizei GLenum GLboolean sink
static void setError(QJsonObject *response, const QString &msg)
#define Q_ASSERT_X(cond, x, msg)
#define qUtf16Printable(string)
#define Q_AUTOTEST_EXPORT
static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &errorSource, qsizetype errorPosition)
static bool equal(const QChar *a, int l, const char *b)
QFuture< QSet< QChar > > set
[10]
file open(QIODevice::ReadOnly)
QUrl url("example.com")
[constructor-url-reference]
QDeadlineTimer deadline(30s)