亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? qprocess_unix.cpp

?? QT 開發(fā)環(huán)境里面一個(gè)很重要的文件
?? CPP
?? 第 1 頁 / 共 3 頁
字號(hào):
            if (&channel == &stdinChannel) {                channel.notifier = new QSocketNotifier(channel.pipe[1],                                                       QSocketNotifier::Write, q);                channel.notifier->setEnabled(false);                QObject::connect(channel.notifier, SIGNAL(activated(int)),                                 q, SLOT(_q_canWrite()));            } else {                channel.notifier = new QSocketNotifier(channel.pipe[0],                                                       QSocketNotifier::Read, q);                const char *receiver;                if (&channel == &stdoutChannel)                    receiver = SLOT(_q_canReadStandardOutput());                else                    receiver = SLOT(_q_canReadStandardError());                QObject::connect(channel.notifier, SIGNAL(activated(int)),                                 q, receiver);            }        }        return true;    } else if (channel.type == Channel::Redirect) {        // we're redirecting the channel to/from a file        QByteArray fname = QFile::encodeName(channel.file);        if (&channel == &stdinChannel) {            // try to open in read-only mode            channel.pipe[1] = -1;            if ( (channel.pipe[0] = open(fname, O_RDONLY)) != -1)                return true;    // success            q->setErrorString(QLatin1String(QT_TRANSLATE_NOOP(QProcess, "Could not open input redirection for reading")));        } else {            int mode = O_WRONLY | O_CREAT;            if (channel.append)                mode |= O_APPEND;            else                mode |= O_TRUNC;            channel.pipe[0] = -1;            if ( (channel.pipe[1] = open(fname, mode, 0666)) != -1)                return true; // success            q->setErrorString(QLatin1String(QT_TRANSLATE_NOOP(QProcess, "Could not open output redirection for writing")));        }        // could not open file        processError = QProcess::FailedToStart;        emit q->error(processError);        cleanup();        return false;    } else {        Q_ASSERT_X(channel.process, "QProcess::start", "Internal error");        Channel *source;        Channel *sink;        if (channel.type == Channel::PipeSource) {            // we are the source            source = &channel;            sink = &channel.process->stdinChannel;            Q_ASSERT(source == &stdoutChannel);            Q_ASSERT(sink->process == this && sink->type == Channel::PipeSink);        } else {            // we are the sink;            source = &channel.process->stdoutChannel;            sink = &channel;            Q_ASSERT(sink == &stdinChannel);            Q_ASSERT(source->process == this && source->type == Channel::PipeSource);        }        if (source->pipe[1] != INVALID_Q_PIPE || sink->pipe[0] != INVALID_Q_PIPE) {            // already created, do nothing            return true;        } else {            Q_ASSERT(source->pipe[0] == INVALID_Q_PIPE && source->pipe[1] == INVALID_Q_PIPE);            Q_ASSERT(sink->pipe[0] == INVALID_Q_PIPE && sink->pipe[1] == INVALID_Q_PIPE);            Q_PIPE pipe[2] = { -1, -1 };            qt_create_pipe(pipe);            sink->pipe[0] = pipe[0];            source->pipe[1] = pipe[1];            return true;        }    }}void QProcessPrivate::startProcess(){    Q_Q(QProcess);#if defined (QPROCESS_DEBUG)    qDebug("QProcessPrivate::startProcess()");#endif    processManager()->start();    // Initialize pipes    qt_create_pipe(childStartedPipe);    if (threadData->eventDispatcher) {        startupSocketNotifier = new QSocketNotifier(childStartedPipe[0],                                                    QSocketNotifier::Read, q);        QObject::connect(startupSocketNotifier, SIGNAL(activated(int)),                         q, SLOT(_q_startupNotification()));    }    qt_create_pipe(deathPipe);    ::fcntl(deathPipe[0], F_SETFD, FD_CLOEXEC);    ::fcntl(deathPipe[1], F_SETFD, FD_CLOEXEC);    if (threadData->eventDispatcher) {        deathNotifier = new QSocketNotifier(deathPipe[0],                                            QSocketNotifier::Read, q);        QObject::connect(deathNotifier, SIGNAL(activated(int)),                         q, SLOT(_q_processDied()));    }    if (!createChannel(stdinChannel) ||        !createChannel(stdoutChannel) ||        !createChannel(stderrChannel))        return;    // Start the process (platform dependent)    processState = QProcess::Starting;    emit q->stateChanged(processState);    QByteArray encodedProg = QFile::encodeName(program);    processManager()->lock();    pid_t childPid = fork();    if (childPid < 0) {        // Cleanup, report error and return        processManager()->unlock();        processState = QProcess::NotRunning;        emit q->stateChanged(processState);        processError = QProcess::FailedToStart;        q->setErrorString(QLatin1String(QT_TRANSLATE_NOOP(QProcess, "Resource error (fork failure)")));        emit q->error(processError);        cleanup();        return;    }    if (childPid == 0) {        execChild(encodedProg);        ::_exit(-1);    }    processManager()->add(childPid, q);    pid = Q_PID(childPid);    processManager()->unlock();    // parent    // close the ends we don't use and make all pipes non-blocking    ::fcntl(deathPipe[0], F_SETFL, ::fcntl(deathPipe[0], F_GETFL) | O_NONBLOCK);    qt_native_close(childStartedPipe[1]);    childStartedPipe[1] = -1;    if (stdinChannel.pipe[0] != -1) {        qt_native_close(stdinChannel.pipe[0]);        stdinChannel.pipe[0] = -1;    }    if (stdinChannel.pipe[1] != -1)        ::fcntl(stdinChannel.pipe[1], F_SETFL, ::fcntl(stdinChannel.pipe[1], F_GETFL) | O_NONBLOCK);    if (stdoutChannel.pipe[1] != -1) {        qt_native_close(stdoutChannel.pipe[1]);        stdoutChannel.pipe[1] = -1;    }    if (stdoutChannel.pipe[0] != -1)        ::fcntl(stdoutChannel.pipe[0], F_SETFL, ::fcntl(stdoutChannel.pipe[0], F_GETFL) | O_NONBLOCK);    if (stderrChannel.pipe[1] != -1) {        qt_native_close(stderrChannel.pipe[1]);        stderrChannel.pipe[1] = -1;    }    if (stderrChannel.pipe[0] != -1)        ::fcntl(stderrChannel.pipe[0], F_SETFL, ::fcntl(stderrChannel.pipe[0], F_GETFL) | O_NONBLOCK);}void QProcessPrivate::execChild(const QByteArray &programName){    ::signal(SIGPIPE, SIG_DFL);         // reset the signal that we ignored    QByteArray encodedProgramName = programName;    Q_Q(QProcess);    // create argument list with right number of elements, and set the    // final one to 0.    char **argv = new char *[arguments.count() + 2];    argv[arguments.count() + 1] = 0;    // allow invoking of .app bundles on the Mac.#ifdef Q_OS_MAC    QFileInfo fileInfo(encodedProgramName);    if (encodedProgramName.endsWith(".app") && fileInfo.isDir()) {        QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(0,                                                          QCFString(fileInfo.absoluteFilePath()),                                                          kCFURLPOSIXPathStyle, true);        QCFType<CFBundleRef> bundle = CFBundleCreate(0, url);        url = CFBundleCopyExecutableURL(bundle);        if (url) {            QCFString str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);            encodedProgramName += "/Contents/MacOS/" + static_cast<QString>(str).toUtf8();        }    }#endif    // add the program name    argv[0] = ::strdup(encodedProgramName.constData());    // add every argument to the list    for (int i = 0; i < arguments.count(); ++i) {        QString arg = arguments.at(i);#ifdef Q_OS_MAC        argv[i + 1] = ::strdup(arg.toUtf8().constData());#else        argv[i + 1] = ::strdup(arg.toLocal8Bit().constData());#endif    }    // copy the stdin socket    qt_native_dup2(stdinChannel.pipe[0], fileno(stdin));    // copy the stdout and stderr if asked to    if (processChannelMode != QProcess::ForwardedChannels) {        qt_native_dup2(stdoutChannel.pipe[1], fileno(stdout));        // merge stdout and stderr if asked to        if (processChannelMode == QProcess::MergedChannels) {            qt_native_dup2(fileno(stdout), fileno(stderr));        } else {            qt_native_dup2(stderrChannel.pipe[1], fileno(stderr));        }    }    // make sure this fd is closed if execvp() succeeds    qt_native_close(childStartedPipe[0]);    ::fcntl(childStartedPipe[1], F_SETFD, FD_CLOEXEC);    // enter the working directory    if (!workingDirectory.isEmpty())        qt_native_chdir(QFile::encodeName(workingDirectory).constData());    // this is a virtual call, and it base behavior is to do nothing.    q->setupChildProcess();    // execute the process    if (environment.isEmpty()) {        qt_native_execvp(argv[0], argv);    } else {        // if LD_LIBRARY_PATH exists in the current environment, but        // not in the environment list passed by the programmer, then        // copy it over.#if defined(Q_OS_MAC)        static const char libraryPath[] = "DYLD_LIBRARY_PATH";#else        static const char libraryPath[] = "LD_LIBRARY_PATH";#endif        const QString libraryPathString = QLatin1String(libraryPath);        QStringList matches = environment.filter(                QRegExp(QLatin1Char('^') + libraryPathString + QLatin1Char('=')));        const QString envLibraryPath = QString::fromLocal8Bit(::getenv(libraryPath));        if (matches.isEmpty() && !envLibraryPath.isEmpty()) {            QString entry = libraryPathString;            entry += QLatin1Char('=');            entry += envLibraryPath;            environment << libraryPathString + QLatin1Char('=') + envLibraryPath;        }        char **envp = new char *[environment.count() + 1];        envp[environment.count()] = 0;        for (int j = 0; j < environment.count(); ++j) {            QString item = environment.at(j);            envp[j] = ::strdup(item.toLocal8Bit().constData());        }        if (!encodedProgramName.contains("/")) {            const QString path = QString::fromLocal8Bit(::getenv("PATH"));            if (!path.isEmpty()) {                QStringList pathEntries = path.split(QLatin1Char(':'));                for (int k = 0; k < pathEntries.size(); ++k) {                    QByteArray tmp = QFile::encodeName(pathEntries.at(k));                    if (!tmp.endsWith('/')) tmp += '/';                    tmp += encodedProgramName;                    argv[0] = tmp.data();#if defined (QPROCESS_DEBUG)                    fprintf(stderr, "QProcessPrivate::execChild() searching / starting %s\n", argv[0]);#endif                    qt_native_execve(argv[0], argv, envp);                }            }        } else {#if defined (QPROCESS_DEBUG)            fprintf(stderr, "QProcessPrivate::execChild() starting %s\n", argv[0]);#endif            qt_native_execve(argv[0], argv, envp);        }    }    // notify failure#if defined (QPROCESS_DEBUG)    fprintf(stderr, "QProcessPrivate::execChild() failed, notifying parent process\n");#endif    qt_native_write(childStartedPipe[1], "", 1);    qt_native_close(childStartedPipe[1]);    childStartedPipe[1] = -1;}bool QProcessPrivate::processStarted(){    char c;    int i = qt_native_read(childStartedPipe[0], &c, 1);    if (startupSocketNotifier) {        startupSocketNotifier->setEnabled(false);        delete startupSocketNotifier;        startupSocketNotifier = 0;    }    qt_native_close(childStartedPipe[0]);    childStartedPipe[0] = -1;#if defined (QPROCESS_DEBUG)    qDebug("QProcessPrivate::processStarted() == %s", i <= 0 ? "true" : "false");#endif    return i <= 0;}qint64 QProcessPrivate::bytesAvailableFromStdout() const{    size_t nbytes = 0;    qint64 available = 0;    if (::ioctl(stdoutChannel.pipe[0], FIONREAD, (char *) &nbytes) >= 0)        available = (qint64) *((int *) &nbytes);#if defined (QPROCESS_DEBUG)    qDebug("QProcessPrivate::bytesAvailableFromStdout() == %lld", available);#endif    return available;}qint64 QProcessPrivate::bytesAvailableFromStderr() const{    size_t nbytes = 0;    qint64 available = 0;    if (::ioctl(stderrChannel.pipe[0], FIONREAD, (char *) &nbytes) >= 0)        available = (qint64) *((int *) &nbytes);#if defined (QPROCESS_DEBUG)    qDebug("QProcessPrivate::bytesAvailableFromStderr() == %lld", available);#endif    return available;}qint64 QProcessPrivate::readFromStdout(char *data, qint64 maxlen){    qint64 bytesRead = qt_native_read(stdoutChannel.pipe[0], data, maxlen);#if defined QPROCESS_DEBUG    qDebug("QProcessPrivate::readFromStdout(%p \"%s\", %lld) == %lld",           data, qt_prettyDebug(data, bytesRead, 16).constData(), maxlen, bytesRead);#endif    return bytesRead;}qint64 QProcessPrivate::readFromStderr(char *data, qint64 maxlen){    qint64 bytesRead = qt_native_read(stderrChannel.pipe[0], data, maxlen);#if defined QPROCESS_DEBUG    qDebug("QProcessPrivate::readFromStderr(%p \"%s\", %lld) == %lld",           data, qt_prettyDebug(data, bytesRead, 16).constData(), maxlen, bytesRead);#endif    return bytesRead;}static void qt_ignore_sigpipe(){    // Set to ignore SIGPIPE once only.    static QBasicAtomic atom = Q_ATOMIC_INIT(0);    if (atom.testAndSet(0, 1)) {        struct sigaction noaction;        memset(&noaction, 0, sizeof(noaction));        noaction.sa_handler = SIG_IGN;        qt_native_sigaction(SIGPIPE, &noaction, 0);    }}qint64 QProcessPrivate::writeToStdin(const char *data, qint64 maxlen){    qt_ignore_sigpipe();    qint64 written = qt_native_write(stdinChannel.pipe[1], data, maxlen);#if defined QPROCESS_DEBUG    qDebug("QProcessPrivate::writeToStdin(%p \"%s\", %lld) == %lld",           data, qt_prettyDebug(data, maxlen, 16).constData(), maxlen, written);#endif    return written;}void QProcessPrivate::terminateProcess(){#if defined (QPROCESS_DEBUG)    qDebug("QProcessPrivate::killProcess()");#endif    if (pid)        ::kill(pid_t(pid), SIGTERM);}void QProcessPrivate::killProcess(){#if defined (QPROCESS_DEBUG)    qDebug("QProcessPrivate::killProcess()");#endif    if (pid)        ::kill(pid_t(pid), SIGKILL);}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产伦精品一区二区三区免费迷| 一区二区三区高清在线| 日本一不卡视频| 欧美一级理论性理论a| 美女精品一区二区| 久久精品欧美一区二区三区麻豆| 粉嫩一区二区三区在线看| 中文字幕一区二区在线播放| 色婷婷综合中文久久一本| 香蕉久久一区二区不卡无毒影院| 欧美一区二区三区日韩视频| 麻豆国产91在线播放| 国产亚洲欧洲一区高清在线观看| 99免费精品视频| 亚洲国产另类av| 精品国产乱码久久久久久牛牛| 国产成人自拍高清视频在线免费播放| 国产精品蜜臀在线观看| 欧美体内she精高潮| 韩国欧美国产1区| 亚洲男人的天堂在线aⅴ视频| 欧美日韩精品一区视频| 国产成人丝袜美腿| 亚洲国产精品视频| 亚洲欧洲精品天堂一级 | 欧美在线观看18| 欧美a级理论片| 国产精品不卡在线| 日韩一区和二区| eeuss鲁片一区二区三区在线观看| 亚洲一区二区欧美日韩| 2023国产精品自拍| 欧美日韩一区二区三区在线看 | 不卡在线观看av| 日本美女视频一区二区| 中文字幕一区二区在线观看| 日韩精品一区二区三区视频播放| 99riav久久精品riav| 久久精品999| 亚洲成av人影院| 中文字幕在线一区免费| 日韩精品一区二区三区四区| 日本久久一区二区| 国产.欧美.日韩| 日本在线不卡视频| 一区二区三区美女视频| 国产亚洲精品bt天堂精选| 日韩欧美一区中文| 欧美视频在线观看一区二区| 风间由美一区二区三区在线观看| 免费看日韩精品| 亚洲国产欧美一区二区三区丁香婷| 国产精品午夜在线| 久久精品视频免费| 欧美videossexotv100| 欧美日韩免费一区二区三区| 91猫先生在线| 成人av网在线| 成人黄色av电影| 国产精品一品二品| 国产一区二区伦理片| 蜜臀99久久精品久久久久久软件| 亚洲国产精品久久久久婷婷884| 18成人在线观看| 亚洲欧洲精品天堂一级| 中文字幕一区在线| 国产精品不卡视频| 亚洲色图视频网| 亚洲色欲色欲www| 亚洲日本丝袜连裤袜办公室| 中文字幕一区二区三区四区不卡| 国产精品毛片高清在线完整版| 久久精品人人爽人人爽| 久久久久久久久久久久久女国产乱 | 在线观看91视频| 在线观看91精品国产入口| 91久久精品国产91性色tv | 成人18精品视频| 成人精品国产免费网站| 成人美女视频在线观看| 大桥未久av一区二区三区中文| 国产成人三级在线观看| 成人精品电影在线观看| 91丝袜高跟美女视频| 色婷婷狠狠综合| 欧美在线免费观看视频| 欧美卡1卡2卡| 怡红院av一区二区三区| 一卡二卡三卡日韩欧美| 视频一区欧美精品| 免费成人在线视频观看| 国产一区二区视频在线播放| 国产成+人+日韩+欧美+亚洲| 成人激情黄色小说| 欧日韩精品视频| 欧美一区二区三区色| 久久久美女毛片| 亚洲精品少妇30p| 日本亚洲一区二区| 韩国视频一区二区| 91啪在线观看| 欧美一区二区三区视频在线 | 国产精品毛片久久久久久久| 亚洲黄色尤物视频| 久久精品国产亚洲一区二区三区 | 中文字幕日本不卡| 午夜精品久久久久影视| 国产精品影音先锋| 欧洲一区二区三区免费视频| 日韩午夜激情av| 亚洲免费观看高清完整版在线观看 | 精品捆绑美女sm三区| 欧美国产丝袜视频| 午夜成人免费视频| 国产成人精品网址| 欧美视频一区在线| 久久亚洲免费视频| 亚洲一区电影777| 久久99精品久久久久久国产越南| 99精品欧美一区二区蜜桃免费 | 日韩一区国产二区欧美三区| 国产精品系列在线| 亚洲国产精品久久久久婷婷884 | 欧美成人高清电影在线| 亚洲丝袜自拍清纯另类| 另类小说图片综合网| 在线免费av一区| 国产三级精品视频| 青青国产91久久久久久| 色噜噜狠狠一区二区三区果冻| 日韩一区二区免费在线观看| 亚洲激情在线播放| 国产高清不卡二三区| 欧美日韩亚洲综合| 亚洲日本丝袜连裤袜办公室| 国产精品1024久久| 亚洲乱码一区二区三区在线观看| 亚洲chinese男男1069| 91丨porny丨蝌蚪视频| 精品国产乱码久久久久久浪潮| 亚洲成人动漫精品| 色综合久久久久综合| 国产精品视频在线看| 国产美女久久久久| 欧美精品丝袜中出| 亚洲一二三区视频在线观看| 92国产精品观看| 中文字幕一区二区三区蜜月 | 蜜桃一区二区三区四区| 欧美日韩中文国产| 亚洲蜜桃精久久久久久久| 成人午夜精品一区二区三区| 精品欧美一区二区三区精品久久| 丝袜国产日韩另类美女| 欧美天堂一区二区三区| 亚洲一区二区高清| 在线这里只有精品| 一区二区三区资源| 色悠悠久久综合| 亚洲一区二区在线视频| 在线观看日韩电影| 亚洲一区在线电影| 欧美日韩在线电影| 午夜电影一区二区三区| 91精品国产综合久久精品图片| 亚洲午夜精品久久久久久久久| 欧美性视频一区二区三区| 亚洲免费色视频| 欧美视频自拍偷拍| 亚洲成人tv网| 欧美一级生活片| 久久精品国产在热久久| 精品久久久久久久久久久久久久久 | 日本二三区不卡| 亚洲资源在线观看| 欧美日韩亚州综合| 日韩成人免费看| 欧美成人一区二区三区| 欧美性大战久久久久久久蜜臀| 亚洲综合色成人| 欧美电影一区二区三区| 性做久久久久久免费观看| 欧美精选午夜久久久乱码6080| 免费观看日韩av| 国产欧美一区二区精品仙草咪 | 激情偷乱视频一区二区三区| 久久综合九色综合欧美就去吻 | 欧美久久一区二区| 久久电影网电视剧免费观看| 久久久久久97三级| 日本乱码高清不卡字幕| 日韩**一区毛片| 久久久久国产免费免费| www.66久久| 日韩高清不卡一区二区| wwww国产精品欧美| 一本久久精品一区二区| 五月天亚洲婷婷| 国产人妖乱国产精品人妖| 色国产综合视频|