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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? qprocess_unix.cpp

?? QT 開發環境里面一個很重要的文件
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
/******************************************************************************** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.**** This file is part of the QtCore module of the Qt Toolkit.**** This file may be used under the terms of the GNU General Public** License version 2.0 as published by the Free Software Foundation** and appearing in the file LICENSE.GPL included in the packaging of** this file.  Please review the following information to ensure GNU** General Public Licensing requirements will be met:** http://www.trolltech.com/products/qt/opensource.html**** If you are unsure which license is appropriate for your use, please** review the following information:** http://www.trolltech.com/products/qt/licensing.html or contact the** sales department at sales@trolltech.com.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************///#define QPROCESS_DEBUG#include "qdebug.h"#ifndef QT_NO_PROCESS#if defined QPROCESS_DEBUG#include "qstring.h"#include <ctype.h>/*    Returns a human readable representation of the first \a len    characters in \a data.*/static QByteArray qt_prettyDebug(const char *data, int len, int maxSize){    if (!data) return "(null)";    QByteArray out;    for (int i = 0; i < len; ++i) {        char c = data[i];        if (isprint(c)) {            out += c;        } else switch (c) {        case '\n': out += "\\n"; break;        case '\r': out += "\\r"; break;        case '\t': out += "\\t"; break;        default:            QString tmp;            tmp.sprintf("\\%o", c);            out += tmp.toLatin1();        }    }    if (len < maxSize)        out += "...";    return out;}#endif#include "qplatformdefs.h"#include "qprocess.h"#include "qprocess_p.h"#ifdef Q_OS_MAC#include <private/qcore_mac_p.h>#endif#include <private/qcoreapplication_p.h>#include <private/qthread_p.h>#include <qdatetime.h>#include <qfile.h>#include <qfileinfo.h>#include <qlist.h>#include <qmap.h>#include <qmutex.h>#include <qsemaphore.h>#include <qsocketnotifier.h>#include <qthread.h>#include <errno.h>#include <stdlib.h>static qint64 qt_native_read(int fd, char *data, qint64 maxlen){    qint64 ret = 0;    do {        ret = ::read(fd, data, maxlen);    } while (ret == -1 && errno == EINTR);    return ret;}static qint64 qt_native_write(int fd, const char *data, qint64 len){    qint64 ret = 0;    do {        ret = ::write(fd, data, len);    } while (ret == -1 && errno == EINTR);    return ret;}static void qt_native_close(int fd){    int ret;    do {        ret = ::close(fd);    } while (ret == -1 && errno == EINTR);}static void qt_native_sigaction(int signum, const struct sigaction *act,                                struct sigaction *oldact){    int ret;    do {        ret = ::sigaction(signum, act, oldact);    } while (ret == -1 && errno == EINTR);}static void qt_native_dup2(int oldfd, int newfd){    int ret;    do {        ret = ::dup2(oldfd, newfd);    } while (ret == -1 && errno == EINTR);}static void qt_native_chdir(const char *path){    int ret;    do {        ret = ::chdir(path);    } while (ret == -1 && errno == EINTR);}static void qt_native_execve(const char *filename, char *const argv[],                              char *const envp[]){    int ret;    do {        ret = ::execve(filename, argv, envp);    } while (ret == -1 && errno == EINTR);}static void qt_native_execv(const char *path, char *const argv[]){    int ret;    do {        ret = ::execv(path, argv);    } while (ret == -1 && errno == EINTR);}static void qt_native_execvp(const char *file, char *const argv[]){    int ret;    do {        ret = ::execvp(file, argv);    } while (ret == -1 && errno == EINTR);}static int qt_qprocess_deadChild_pipe[2];static void (*qt_sa_old_sigchld_handler)(int) = 0;static void qt_sa_sigchld_handler(int signum){    qt_native_write(qt_qprocess_deadChild_pipe[1], "", 1);#if defined (QPROCESS_DEBUG)    fprintf(stderr, "*** SIGCHLD\n");#endif    if (qt_sa_old_sigchld_handler && qt_sa_old_sigchld_handler != SIG_IGN)        qt_sa_old_sigchld_handler(signum);}struct QProcessInfo {    QProcess *process;    int deathPipe;    int exitResult;    pid_t pid;    int serialNumber;};class QProcessManager : public QThread{    Q_OBJECTpublic:    QProcessManager();    ~QProcessManager();    void run();    void catchDeadChildren();    void add(pid_t pid, QProcess *process);    void remove(QProcess *process);    void lock();    void unlock();private:    QMutex mutex;    QMap<int, QProcessInfo *> children;};Q_GLOBAL_STATIC(QProcessManager, processManager)QProcessManager::QProcessManager(){#if defined (QPROCESS_DEBUG)    qDebug() << "QProcessManager::QProcessManager()";#endif    // initialize the dead child pipe and make it non-blocking. in the    // extremely unlikely event that the pipe fills up, we do not under any    // circumstances want to block.    ::pipe(qt_qprocess_deadChild_pipe);    ::fcntl(qt_qprocess_deadChild_pipe[0], F_SETFD, FD_CLOEXEC);    ::fcntl(qt_qprocess_deadChild_pipe[1], F_SETFD, FD_CLOEXEC);    ::fcntl(qt_qprocess_deadChild_pipe[0], F_SETFL,	    ::fcntl(qt_qprocess_deadChild_pipe[0], F_GETFL) | O_NONBLOCK);    ::fcntl(qt_qprocess_deadChild_pipe[1], F_SETFL,	    ::fcntl(qt_qprocess_deadChild_pipe[1], F_GETFL) | O_NONBLOCK);    // set up the SIGCHLD handler, which writes a single byte to the dead    // child pipe every time a child dies.    struct sigaction oldAction;    struct sigaction action;    memset(&action, 0, sizeof(action));    action.sa_handler = qt_sa_sigchld_handler;    action.sa_flags = SA_NOCLDSTOP;    qt_native_sigaction(SIGCHLD, &action, &oldAction);    if (oldAction.sa_handler != qt_sa_sigchld_handler)	qt_sa_old_sigchld_handler = oldAction.sa_handler;}QProcessManager::~QProcessManager(){    // notify the thread that we're shutting down.    qt_native_write(qt_qprocess_deadChild_pipe[1], "@", 1);    qt_native_close(qt_qprocess_deadChild_pipe[1]);    wait();    // on certain unixes, closing the reading end of the pipe will cause    // select in run() to block forever, rather than return with EBADF.    qt_native_close(qt_qprocess_deadChild_pipe[0]);    qt_qprocess_deadChild_pipe[0] = -1;    qt_qprocess_deadChild_pipe[1] = -1;    qDeleteAll(children.values());    children.clear();}void QProcessManager::run(){    forever {        fd_set readset;        FD_ZERO(&readset);        FD_SET(qt_qprocess_deadChild_pipe[0], &readset);#if defined (QPROCESS_DEBUG)        qDebug() << "QProcessManager::run() waiting for children to die";#endif        // block forever, or until activity is detected on the dead child        // pipe. the only other peers are the SIGCHLD signal handler, and the        // QProcessManager destructor.        int nselect = select(qt_qprocess_deadChild_pipe[0] + 1, &readset, 0, 0, 0);        if (nselect < 0) {            if (errno == EINTR)                continue;            break;        }        // empty only one byte from the pipe, even though several SIGCHLD        // signals may have been delivered in the meantime, to avoid race        // conditions.        char c;        if (qt_native_read(qt_qprocess_deadChild_pipe[0], &c, 1) < 0 || c == '@')            break;        // catch any and all children that we can.        catchDeadChildren();    }}void QProcessManager::catchDeadChildren(){    QMutexLocker locker(&mutex);    // try to catch all children whose pid we have registered, and whose    // deathPipe is still valid (i.e, we have not already notified it).    QMap<int, QProcessInfo *>::Iterator it = children.begin();    while (it != children.end()) {        // notify all children that they may have died. they need to run        // waitpid() in their own thread.        QProcessInfo *info = it.value();        qt_native_write(info->deathPipe, "", 1);#if defined (QPROCESS_DEBUG)        qDebug() << "QProcessManager::run() sending death notice to" << info->process;#endif        ++it;    }}static QBasicAtomic idCounter = Q_ATOMIC_INIT(1);static int qt_qprocess_nextId(){    register int id;    for (;;) {        id = idCounter;        if (idCounter.testAndSet(id, id + 1))            break;    }    return id;}void QProcessManager::add(pid_t pid, QProcess *process){#if defined (QPROCESS_DEBUG)    qDebug() << "QProcessManager::add() adding pid" << pid << "process" << process;#endif    // insert a new info structure for this process    QProcessInfo *info = new QProcessInfo;    info->process = process;    info->deathPipe = process->d_func()->deathPipe[1];    info->exitResult = 0;    info->pid = pid;    int serial = qt_qprocess_nextId();    process->d_func()->serial = serial;    children.insert(serial, info);}void QProcessManager::remove(QProcess *process){    QMutexLocker locker(&mutex);    int serial = process->d_func()->serial;    QProcessInfo *info = children.value(serial);    if (!info)        return;#if defined (QPROCESS_DEBUG)    qDebug() << "QProcessManager::remove() removing pid" << info->pid << "process" << info->process;#endif    children.remove(serial);    delete info;}void QProcessManager::lock(){    mutex.lock();}void QProcessManager::unlock(){    mutex.unlock();}static void qt_create_pipe(int *pipe){    if (pipe[0] != -1)        qt_native_close(pipe[0]);    if (pipe[1] != -1)        qt_native_close(pipe[1]);#ifdef Q_OS_IRIX    if (::socketpair(AF_UNIX, SOCK_STREAM, 0, pipe) == -1) {        qWarning("QProcessPrivate::createPipe: Cannot create pipe %p: %s",                 pipe, qPrintable(qt_error_string(errno)));    }#else    if (::pipe(pipe) != 0) {        qWarning("QProcessPrivate::createPipe: Cannot create pipe %p: %s",                 pipe, qPrintable(qt_error_string(errno)));    }#endif    ::fcntl(pipe[0], F_SETFD, FD_CLOEXEC);    ::fcntl(pipe[1], F_SETFD, FD_CLOEXEC);}void QProcessPrivate::destroyPipe(int *pipe){    if (pipe[1] != -1) {        qt_native_close(pipe[1]);        pipe[1] = -1;    }    if (pipe[0] != -1) {        qt_native_close(pipe[0]);        pipe[0] = -1;    }}/*    Create the pipes to a QProcessPrivate::Channel.    This function must be called in order: stdin, stdout, stderr*/bool QProcessPrivate::createChannel(Channel &channel){    Q_Q(QProcess);    if (&channel == &stderrChannel && processChannelMode == QProcess::MergedChannels) {        channel.pipe[0] = -1;        channel.pipe[1] = -1;        return true;    }    if (channel.type == Channel::Normal) {        // we're piping this channel to our own process        qt_create_pipe(channel.pipe);        // create the socket notifiers        if (threadData->eventDispatcher) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美视频第二页| 欧美一区二区日韩一区二区| 精品少妇一区二区三区在线播放| 日日夜夜免费精品| 91精品国产综合久久久久| 奇米888四色在线精品| 久久一留热品黄| 成人黄色小视频| 亚洲国产精品天堂| 欧美一区二区三区人| 国产精品中文字幕一区二区三区| 久久久国产一区二区三区四区小说 | 欧美丰满一区二区免费视频| 三级成人在线视频| 国产亚洲综合色| 色婷婷av久久久久久久| 免费一级片91| 国产精品天美传媒沈樵| 欧美主播一区二区三区| 青青草国产精品亚洲专区无| 久久麻豆一区二区| 337p亚洲精品色噜噜狠狠| 99久久99久久精品免费看蜜桃| 亚洲人成亚洲人成在线观看图片| 欧美日韩精品一区二区三区四区 | 久久精品久久99精品久久| 久久精品视频在线看| 欧美在线一二三四区| 国产一区二区按摩在线观看| 亚洲激情在线激情| 久久影视一区二区| 欧美日韩一区二区三区不卡| 国产高清在线观看免费不卡| 一区二区欧美在线观看| 久久久久久黄色| 欧美日韩高清影院| 粉嫩aⅴ一区二区三区四区| 亚洲电影你懂得| 国产亚洲成年网址在线观看| 欧美日韩一级二级| av激情成人网| 精品在线亚洲视频| 午夜在线电影亚洲一区| 国产视频视频一区| 91精品国产综合久久小美女| 成人av第一页| 国产一区二区三区在线观看精品| 亚洲va韩国va欧美va| 日韩理论片网站| 久久久精品国产免大香伊 | 日韩欧美国产综合一区| 色综合久久久久久久久| 国产成人亚洲精品青草天美| 日本不卡视频一二三区| 一区二区三区资源| 国产精品久久精品日日| 日韩三级免费观看| 欧美美女视频在线观看| 一本色道久久综合亚洲aⅴ蜜桃| 国产精品一区二区在线看| 日韩av二区在线播放| 亚洲妇熟xx妇色黄| 一区二区三区四区av| 中文字幕亚洲电影| 国产精品久久久久久妇女6080 | 欧美一区二区三区四区高清| 欧美中文字幕亚洲一区二区va在线 | 色94色欧美sute亚洲线路一ni| 国产成人精品免费| 国产一区二区三区不卡在线观看| 久久精品国产一区二区| 蜜臀久久久99精品久久久久久| 午夜精品久久久久久久99樱桃| 亚洲一区二区三区精品在线| 亚洲免费观看高清在线观看| 中文字幕在线播放不卡一区| 国产精品电影一区二区三区| 国产精品乱码一区二区三区软件| 国产三区在线成人av| 国产色婷婷亚洲99精品小说| 国产欧美一区二区三区在线老狼 | 成人av在线一区二区三区| 成人在线综合网站| 99麻豆久久久国产精品免费 | 亚洲第一电影网| 视频一区免费在线观看| 蜜桃91丨九色丨蝌蚪91桃色| 精品亚洲国内自在自线福利| 国产一区二区三区不卡在线观看| 国产精品香蕉一区二区三区| 国产suv精品一区二区6| 不卡一区二区三区四区| 91搞黄在线观看| 欧美人牲a欧美精品| 欧美大片免费久久精品三p| 久久网站最新地址| 国产精品你懂的在线欣赏| 中文字幕一区二区三区乱码在线| 亚洲人成网站色在线观看| 亚洲午夜久久久久| 蜜桃视频一区二区三区在线观看| 国产乱码精品一区二区三| 成人精品免费视频| 欧美三级一区二区| 欧美精品一区二区三区高清aⅴ| 国产三级精品三级| 亚洲午夜一二三区视频| 九色|91porny| 色综合久久久久综合| 日韩一区二区三区视频| 国产精品久久久久久久第一福利| 亚洲小少妇裸体bbw| 国产一区二区三区免费| 91国偷自产一区二区三区成为亚洲经典| 在线综合亚洲欧美在线视频| 国产亚洲欧洲一区高清在线观看| 一区二区在线观看免费| 激情伊人五月天久久综合| 北条麻妃一区二区三区| 欧美一级免费大片| 亚洲视频香蕉人妖| 狠狠色综合日日| 欧美亚洲综合另类| 国产日韩精品一区二区浪潮av | 丝袜美腿成人在线| 成人精品免费网站| 日韩欧美在线1卡| 亚洲综合在线观看视频| 精品一二线国产| 欧美午夜视频网站| 久久―日本道色综合久久| 亚洲综合999| av亚洲精华国产精华精华| 91精品欧美福利在线观看| 国产精品护士白丝一区av| 麻豆91在线播放| 欧美日韩一区二区在线观看| 国产日韩欧美亚洲| 精品中文字幕一区二区小辣椒| 91国偷自产一区二区三区观看| 国产亚洲精品bt天堂精选| 日韩av网站免费在线| 在线精品视频一区二区| 国产精品午夜在线| 国产一区二区三区在线观看精品 | 91猫先生在线| 国产精品久线在线观看| 国产高清成人在线| 精品久久久三级丝袜| 日韩av网站在线观看| 欧美日韩免费在线视频| 亚洲午夜精品在线| 在线观看欧美黄色| 中文字幕色av一区二区三区| 国产成人免费在线观看不卡| 日韩欧美国产成人一区二区| 天天影视色香欲综合网老头| 色香蕉成人二区免费| 国产精品久久国产精麻豆99网站| 国产麻豆午夜三级精品| 2023国产一二三区日本精品2022| 免费人成网站在线观看欧美高清| 欧美日韩高清一区二区三区| 亚洲成人精品一区二区| 欧美午夜一区二区三区免费大片| 亚洲欧美日韩国产成人精品影院| 不卡的av电影| 综合久久国产九一剧情麻豆| www.欧美.com| 亚洲美女免费在线| 欧美性一二三区| 日韩精品乱码免费| 日韩欧美国产一区二区在线播放| 免费成人在线播放| 日韩精品专区在线| 国产伦精一区二区三区| 国产午夜亚洲精品羞羞网站| 成人午夜在线免费| 自拍av一区二区三区| 91国在线观看| 日本va欧美va瓶| 欧美精品一区二区三区蜜臀| 国产福利一区二区三区视频| 国产精品理论在线观看| 色婷婷综合久久久久中文| 亚洲制服丝袜av| 欧美xfplay| www.亚洲精品| 亚洲成va人在线观看| 欧美videos中文字幕| 成人黄动漫网站免费app| 亚洲一区二区三区视频在线| 欧美一级二级在线观看| 国产乱码精品一品二品| 亚洲欧美日韩一区二区 | 精品视频在线免费看| 激情综合网最新| 成人欧美一区二区三区白人| 欧美日韩不卡一区| 国产精品一级在线|