亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
色综合久久中文字幕综合网| 国产一区二区三区精品视频| 欧美自拍丝袜亚洲| 亚洲宅男天堂在线观看无病毒 | 99精品视频在线免费观看| 日本一区二区三区dvd视频在线| 国产传媒日韩欧美成人| 成人欧美一区二区三区1314| 色婷婷综合久久久久中文| 亚洲国产精品一区二区久久 | 在线视频一区二区三区| 亚洲福利一区二区三区| 欧美一区二区三区的| 国产在线观看免费一区| 国产精品久久久久久久久搜平片 | 国产一区二区女| 国产精品你懂的| 欧美精品日日鲁夜夜添| 国内外成人在线| 亚洲品质自拍视频网站| 日韩亚洲电影在线| 不卡视频在线看| 日本在线不卡视频一二三区| 久久久五月婷婷| 色婷婷久久综合| 精品中文字幕一区二区| 亚洲精品大片www| 欧美成人一区二区三区片免费| 丁香亚洲综合激情啪啪综合| 有码一区二区三区| 久久综合色鬼综合色| 在线免费观看日本欧美| 国产福利精品一区| 午夜精品国产更新| 国产精品久久久久久妇女6080| 制服.丝袜.亚洲.中文.综合| 国产成a人无v码亚洲福利| 天涯成人国产亚洲精品一区av| 国产视频一区在线观看| 337p亚洲精品色噜噜| 成人久久18免费网站麻豆| 亚洲超碰精品一区二区| 一区在线观看免费| 精品动漫一区二区三区在线观看| 91久久线看在观草草青青| 狠狠色丁香久久婷婷综| 亚洲成人第一页| 椎名由奈av一区二区三区| 久久伊人蜜桃av一区二区| 欧美美女喷水视频| 一本久久a久久免费精品不卡| 国产一区二区视频在线| 午夜伊人狠狠久久| 悠悠色在线精品| 国产精品日韩成人| 久久久美女艺术照精彩视频福利播放| 欧美三级电影在线看| 97久久久精品综合88久久| 国产成人av一区二区| 免费观看日韩电影| 秋霞影院一区二区| 午夜精品久久久久久不卡8050| 亚洲精品成人精品456| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 久久国产福利国产秒拍| 日韩激情av在线| 日韩精品一二区| 亚欧色一区w666天堂| 亚洲国产综合视频在线观看| 亚洲精品久久嫩草网站秘色| 国产精品传媒在线| 成人欧美一区二区三区| ...xxx性欧美| 中文字幕一区二区三区在线播放 | 亚洲一二三区不卡| 亚洲精品网站在线观看| 亚洲免费电影在线| 一区二区三区色| 亚洲一区在线视频| 亚洲国产视频一区二区| 亚洲一卡二卡三卡四卡五卡| 亚洲综合在线电影| 亚洲444eee在线观看| 午夜av一区二区三区| 欧美a级理论片| 国产麻豆精品在线| 成人综合婷婷国产精品久久蜜臀 | 日韩精品电影一区亚洲| 日韩不卡手机在线v区| 青青草91视频| 国产成人自拍在线| av网站免费线看精品| 色88888久久久久久影院野外| 欧美伊人精品成人久久综合97 | 国产精品1区2区3区在线观看| 成人丝袜视频网| 色天使色偷偷av一区二区| 欧美精品亚洲一区二区在线播放| 精品日本一线二线三线不卡| 中文无字幕一区二区三区| 国产精品久久久久国产精品日日| 亚洲另类在线制服丝袜| 日韩不卡一区二区三区 | 99久久婷婷国产精品综合| 色综合久久综合| 日韩一区二区三区电影| 国产精品久久久久久亚洲伦| 亚洲国产成人91porn| 国内精品国产成人国产三级粉色 | 国产日韩三级在线| 亚洲黄色小说网站| 精品亚洲免费视频| 97se亚洲国产综合自在线| 欧美精品日韩一区| 国产精品久久久爽爽爽麻豆色哟哟| 亚洲在线中文字幕| 国产99久久久国产精品免费看| 色婷婷av一区| 久久久久国色av免费看影院| 亚洲一区二区三区四区中文字幕| 精品一区免费av| 欧美午夜理伦三级在线观看| 久久久久一区二区三区四区| 亚洲一区成人在线| 成人爱爱电影网址| 欧美一区二区三区视频在线观看| 国产精品全国免费观看高清| 蜜桃视频一区二区三区在线观看| 成人av动漫网站| 久久综合精品国产一区二区三区| 亚洲午夜国产一区99re久久| 成人禁用看黄a在线| 日韩欧美国产综合一区| 亚洲免费成人av| 成人国产电影网| 精品国产一区二区亚洲人成毛片| 亚洲综合在线视频| 99国产欧美另类久久久精品| 精品久久久久久久久久久久久久久久久 | 中文字幕精品在线不卡| 老司机精品视频在线| 欧美日韩中文字幕一区二区| 国产精品乱码妇女bbbb| 久久er99热精品一区二区| 7777精品久久久大香线蕉| 亚洲精品中文字幕乱码三区 | 一区二区三区高清| 成人激情视频网站| 国产亚洲欧美激情| 国产精品一区二区在线看| 欧美一区二区三区视频免费| 亚洲成人免费在线| 欧美亚洲高清一区二区三区不卡| 国产精品麻豆99久久久久久| 国产成人精品免费一区二区| 久久视频一区二区| 国产一区二区三区在线看麻豆| 日韩一区二区三区高清免费看看| 午夜精品福利一区二区三区av| 91久久精品日日躁夜夜躁欧美| 亚洲欧美日韩久久| 99久久精品情趣| 国产精品麻豆视频| 色综合天天在线| 夜夜嗨av一区二区三区四季av| 色综合激情久久| 亚洲最大成人综合| 欧美中文一区二区三区| 性感美女极品91精品| 欧美女孩性生活视频| 日韩激情视频网站| 日韩精品在线网站| 国产曰批免费观看久久久| 国产午夜精品理论片a级大结局| 丁香桃色午夜亚洲一区二区三区| 国产欧美一区二区精品性| fc2成人免费人成在线观看播放 | 亚洲成年人影院| 欧美一区二区三区思思人| 九九精品一区二区| 国产精品毛片无遮挡高清| 色狠狠色狠狠综合| 日韩av不卡一区二区| 日韩精品一区二区三区swag| 国产精品中文字幕一区二区三区| 亚洲国产成人自拍| 欧美亚洲自拍偷拍| 免费不卡在线观看| 中文字幕不卡一区| 色琪琪一区二区三区亚洲区| 一区二区欧美国产| 欧美不卡一区二区| www.亚洲在线| 天天影视涩香欲综合网| 亚洲精品一区二区三区影院 | 国产一区二区三区综合| 国产精品久久久久久久久免费桃花| 在线亚洲+欧美+日本专区| 久久精品国产网站| 中文字幕在线播放不卡一区|