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

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

?? proc.c

?? apr-1.2.7.tar.gz源碼 支持svn的需求
?? C
字號:
/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * *     http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */#include "apr_arch_threadproc.h"#include "apr_strings.h"struct send_pipe {	int in;	int out;	int err;};APR_DECLARE(apr_status_t) apr_procattr_create(apr_procattr_t **new, apr_pool_t *pool){    (*new) = (apr_procattr_t *)apr_palloc(pool,               sizeof(apr_procattr_t));    if ((*new) == NULL) {        return APR_ENOMEM;    }    (*new)->pool = pool;    (*new)->parent_in = NULL;    (*new)->child_in = NULL;    (*new)->parent_out = NULL;    (*new)->child_out = NULL;    (*new)->parent_err = NULL;    (*new)->child_err = NULL;    (*new)->currdir = NULL;     (*new)->cmdtype = APR_PROGRAM;    (*new)->detached = 0;    return APR_SUCCESS;}APR_DECLARE(apr_status_t) apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in,                                               apr_int32_t out, apr_int32_t err){    apr_status_t status;    if (in != 0) {        if ((status = apr_file_pipe_create(&attr->child_in, &attr->parent_in,                                    attr->pool)) != APR_SUCCESS) {            return status;        }        switch (in) {        case APR_FULL_BLOCK:            apr_file_pipe_timeout_set(attr->child_in, -1);            apr_file_pipe_timeout_set(attr->parent_in, -1);            break;        case APR_PARENT_BLOCK:            apr_file_pipe_timeout_set(attr->child_in, -1);            break;        case APR_CHILD_BLOCK:            apr_file_pipe_timeout_set(attr->parent_in, -1);            break;        default:            break;        }    }     if (out) {        if ((status = apr_file_pipe_create(&attr->parent_out, &attr->child_out,                                    attr->pool)) != APR_SUCCESS) {            return status;        }        switch (out) {        case APR_FULL_BLOCK:            apr_file_pipe_timeout_set(attr->child_out, -1);            apr_file_pipe_timeout_set(attr->parent_out, -1);                   break;        case APR_PARENT_BLOCK:            apr_file_pipe_timeout_set(attr->child_out, -1);            break;        case APR_CHILD_BLOCK:            apr_file_pipe_timeout_set(attr->parent_out, -1);            break;        default:            break;        }    }     if (err) {        if ((status = apr_file_pipe_create(&attr->parent_err, &attr->child_err,                                    attr->pool)) != APR_SUCCESS) {            return status;        }        switch (err) {        case APR_FULL_BLOCK:            apr_file_pipe_timeout_set(attr->child_err, -1);            apr_file_pipe_timeout_set(attr->parent_err, -1);            break;        case APR_PARENT_BLOCK:            apr_file_pipe_timeout_set(attr->child_err, -1);            break;        case APR_CHILD_BLOCK:            apr_file_pipe_timeout_set(attr->parent_err, -1);            break;        default:            break;        }    }     return APR_SUCCESS;}APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr,                                                const char *dir) {    char * cwd;    if (dir[0] != '/') {        cwd = (char*)malloc(sizeof(char) * PATH_MAX);        getcwd(cwd, PATH_MAX);        attr->currdir = (char *)apr_pstrcat(attr->pool, cwd, "/", dir, NULL);        free(cwd);    } else {        attr->currdir = (char *)apr_pstrdup(attr->pool, dir);    }    if (attr->currdir) {        return APR_SUCCESS;    }    return APR_ENOMEM;}APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr,                                                   apr_cmdtype_e cmd) {    attr->cmdtype = cmd;    return APR_SUCCESS;}APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach) {    attr->detached = detach;    return APR_SUCCESS;}APR_DECLARE(apr_status_t) apr_proc_fork(apr_proc_t *proc, apr_pool_t *pool){    int pid;        if ((pid = fork()) < 0) {        return errno;    }    else if (pid == 0) {		/* This is really ugly...		 * The semantics of BeOS's fork() are that areas (used for shared		 * memory) get COW'd :-( The only way we can make shared memory		 * work across fork() is therefore to find any areas that have		 * been created and then clone them into our address space.         * Thankfully only COW'd areas have the lock variable set at         * anything but 0, so we can use that to find the areas we need to         * copy. Of course what makes it even worse is that the loop through         * the area's will go into an infinite loop, eating memory and then         * eventually segfault unless we know when we reach then end of the         * "original" areas and stop. Why? Well, we delete the area and then         * add another to the end of the list...		 */		area_info ai;		int32 cookie = 0;        area_id highest = 0;		        while (get_next_area_info(0, &cookie, &ai) == B_OK)            if (ai.area	> highest)                highest = ai.area;        cookie = 0;        while (get_next_area_info(0, &cookie, &ai) == B_OK) {            if (ai.area > highest)                break;            if (ai.lock > 0) {                area_id original = find_area(ai.name);                delete_area(ai.area);                clone_area(ai.name, &ai.address, B_CLONE_ADDRESS,                           ai.protection, original);            }        }		        proc->pid = pid;        proc->in = NULL;         proc->out = NULL;         proc->err = NULL;        return APR_INCHILD;    }    proc->pid = pid;    proc->in = NULL;     proc->out = NULL;     proc->err = NULL;     return APR_INPARENT;}APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr,                                                       apr_child_errfn_t *errfn){    /* won't ever be called on this platform, so don't save the function pointer */    return APR_SUCCESS;}APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr,                                                       apr_int32_t chk){    /* won't ever be used on this platform, so don't save the flag */    return APR_SUCCESS;}APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr,                                                       apr_int32_t addrspace){    /* won't ever be used on this platform, so don't save the flag */    return APR_SUCCESS;}APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, const char *progname,                                           const char * const *args,                                          const char * const *env,                                           apr_procattr_t *attr,                                           apr_pool_t *pool){    int i=0,nargs=0;    char **newargs = NULL;    thread_id newproc, sender;    struct send_pipe *sp;            char * dir = NULL;	        sp = (struct send_pipe *)apr_palloc(pool, sizeof(struct send_pipe));    new->in = attr->parent_in;    new->err = attr->parent_err;    new->out = attr->parent_out;	sp->in  = attr->child_in  ? attr->child_in->filedes  : -1;	sp->out = attr->child_out ? attr->child_out->filedes : -1;	sp->err = attr->child_err ? attr->child_err->filedes : -1;    i = 0;    while (args && args[i]) {        i++;    }	newargs = (char**)malloc(sizeof(char *) * (i + 4));	newargs[0] = strdup("/boot/home/config/bin/apr_proc_stub");    if (attr->currdir == NULL) {        /* we require the directory , so use a temp. variable */        dir = malloc(sizeof(char) * PATH_MAX);        getcwd(dir, PATH_MAX);        newargs[1] = strdup(dir);        free(dir);    } else {        newargs[1] = strdup(attr->currdir);    }    newargs[2] = strdup(progname);    i=0;nargs = 3;    while (args && args[i]) {        newargs[nargs] = strdup(args[i]);        i++;nargs++;    }    newargs[nargs] = NULL;    /* ### we should be looking at attr->cmdtype in here... */    newproc = load_image(nargs, (const char**)newargs, (const char**)env);    /* load_image copies the data so now we can free it... */    while (--nargs >= 0)        free (newargs[nargs]);    free(newargs);            if (newproc < B_NO_ERROR) {        return errno;    }    resume_thread(newproc);    if (attr->child_in) {        apr_file_close(attr->child_in);    }    if (attr->child_out) {        apr_file_close(attr->child_out);    }    if (attr->child_err) {        apr_file_close(attr->child_err);    }    send_data(newproc, 0, (void*)sp, sizeof(struct send_pipe));    new->pid = newproc;    /* before we go charging on we need the new process to get to a      * certain point.  When it gets there it'll let us know and we     * can carry on. */    receive_data(&sender, (void*)NULL,0);        return APR_SUCCESS;}APR_DECLARE(apr_status_t) apr_proc_wait_all_procs(apr_proc_t *proc,                                                  int *exitcode,                                                  apr_exit_why_e *exitwhy,                                                  apr_wait_how_e waithow,                                                   apr_pool_t *p){    proc->pid = -1;    return apr_proc_wait(proc, exitcode, exitwhy, waithow);} APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc,                                        int *exitcode,                                         apr_exit_why_e *exitwhy,                                        apr_wait_how_e waithow){    pid_t pstatus;    int waitpid_options = WUNTRACED;    int exit_int;    int ignore;    apr_exit_why_e ignorewhy;    if (exitcode == NULL) {        exitcode = &ignore;    }    if (exitwhy == NULL) {        exitwhy = &ignorewhy;    }    if (waithow != APR_WAIT) {        waitpid_options |= WNOHANG;    }    if ((pstatus = waitpid(proc->pid, &exit_int, waitpid_options)) > 0) {        proc->pid = pstatus;        if (WIFEXITED(exit_int)) {            *exitwhy = APR_PROC_EXIT;            *exitcode = WEXITSTATUS(exit_int);        }        else if (WIFSIGNALED(exit_int)) {            *exitwhy = APR_PROC_SIGNAL;            *exitcode = WTERMSIG(exit_int);        }        else {            /* unexpected condition */            return APR_EGENERAL;        }        return APR_CHILD_DONE;    }    else if (pstatus == 0) {        return APR_CHILD_NOTDONE;    }    return errno;} APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_file_t *child_in,                                   apr_file_t *parent_in){    if (attr->child_in == NULL && attr->parent_in == NULL)        apr_file_pipe_create(&attr->child_in, &attr->parent_in, attr->pool);    if (child_in != NULL)        apr_file_dup(&attr->child_in, child_in, attr->pool);    if (parent_in != NULL)        apr_file_dup(&attr->parent_in, parent_in, attr->pool);    return APR_SUCCESS;}APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_file_t *child_out,                                                     apr_file_t *parent_out){    if (attr->child_out == NULL && attr->parent_out == NULL)        apr_file_pipe_create(&attr->child_out, &attr->parent_out, attr->pool);    if (child_out != NULL)        apr_file_dup(&attr->child_out, child_out, attr->pool);    if (parent_out != NULL)        apr_file_dup(&attr->parent_out, parent_out, attr->pool);    return APR_SUCCESS;}APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_file_t *child_err,                                                     apr_file_t *parent_err){    if (attr->child_err == NULL && attr->parent_err == NULL)        apr_file_pipe_create(&attr->child_err, &attr->parent_err, attr->pool);    if (child_err != NULL)        apr_file_dup(&attr->child_err, child_err, attr->pool);    if (parent_err != NULL)        apr_file_dup(&attr->parent_err, parent_err, attr->pool);    return APR_SUCCESS;}APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what,                                                   void *limit){    return APR_ENOTIMPL;}APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr,                                                 const char *username,                                                const char *password){    return APR_ENOTIMPL;}APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr,                                                 const char *groupname){    return APR_ENOTIMPL;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲最新视频在线播放| 亚洲成av人片在线观看| 亚洲午夜一区二区三区| 欧美日韩夫妻久久| 日韩精品一区二区在线观看| 久久精品水蜜桃av综合天堂| 中文字幕一区二区三区不卡| 奇米一区二区三区| 亚洲欧美日韩久久| 日本aⅴ亚洲精品中文乱码| 欧美日韩精品免费观看视频| 中文字幕在线不卡视频| 午夜成人免费电影| 一区二区三区av电影| 欧美日产国产精品| 在线观看亚洲a| 在线观看视频一区二区| 色婷婷综合在线| 暴力调教一区二区三区| 成人av网站在线| 国产一区欧美日韩| 国产suv精品一区二区883| 91麻豆国产自产在线观看| 7777精品伊人久久久大香线蕉 | 亚洲欧美日韩国产另类专区| 精一区二区三区| 97久久久精品综合88久久| 蜜臀av性久久久久蜜臀av麻豆| 奇米影视一区二区三区| 色婷婷国产精品| 国产欧美在线观看一区| 五月天一区二区三区| 国产成人精品亚洲777人妖| 欧美色视频一区| 国产精品国模大尺度视频| 国产经典欧美精品| 欧美xxxxx牲另类人与| 日韩精品一区第一页| 日本乱人伦一区| 一区二区欧美视频| 欧美性一区二区| 亚洲福中文字幕伊人影院| 97精品国产露脸对白| 国产亚洲精品久| 亚洲日本护士毛茸茸| 在线视频一区二区免费| 一区二区三区四区在线| 欧美日韩精品免费观看视频| 亚洲一区二区三区在线播放| 欧美高清视频不卡网| 午夜精品福利一区二区三区蜜桃| 国产精品正在播放| 国产精品乱人伦中文| 欧美性xxxxx极品少妇| 天堂成人国产精品一区| 久久久久久久久免费| av影院午夜一区| 免费国产亚洲视频| 国产精品久久久久久久浪潮网站| 91尤物视频在线观看| 日本不卡一区二区| 成人免费在线视频观看| 欧美精品乱码久久久久久按摩| 国产在线精品不卡| 亚洲综合色噜噜狠狠| 3d动漫精品啪啪1区2区免费 | 久久综合久久综合久久综合| 99久久国产综合精品麻豆| 亚洲图片有声小说| 国产精品免费看片| 日韩女优电影在线观看| 欧美亚洲禁片免费| bt欧美亚洲午夜电影天堂| 国产a级毛片一区| 久久电影国产免费久久电影| 亚洲一卡二卡三卡四卡五卡| 国产精品久久久久一区二区三区共| 欧美mv和日韩mv的网站| 91免费国产在线| 国产精品亚洲专一区二区三区 | 大白屁股一区二区视频| av一区二区三区四区| 欧美精品123区| 亚洲国产高清在线观看视频| 亚洲日本青草视频在线怡红院 | 91精品福利视频| 欧美一区二区在线观看| 国产视频一区二区在线观看| 亚洲综合色丁香婷婷六月图片| 久久精工是国产品牌吗| 一本久道中文字幕精品亚洲嫩| 日韩免费福利电影在线观看| 久久久国产精品午夜一区ai换脸| 亚洲精品伦理在线| 国产91在线|亚洲| 日韩欧美视频在线| 亚洲五码中文字幕| 93久久精品日日躁夜夜躁欧美| 久久一区二区三区国产精品| 亚洲午夜电影网| 欧美色电影在线| 一区二区三区精品在线| 成人的网站免费观看| 国产精品亲子伦对白| 国产精品91xxx| 欧美激情一区在线| 国产福利一区二区三区在线视频| 在线播放国产精品二区一二区四区| 国产精品久线在线观看| 福利91精品一区二区三区| 国产精品看片你懂得| 理论电影国产精品| 久久久久久久电影| 成人免费视频视频| 国产精品福利一区二区| 色哟哟一区二区三区| 亚洲欧美aⅴ...| 国产成人一区二区精品非洲| 国产一区日韩二区欧美三区| 麻豆精品视频在线| 久久久久久久久久久电影| 国产伦精品一区二区三区免费迷 | 国产精品久久久久久久久免费桃花 | 亚洲精品日韩综合观看成人91| 在线观看区一区二| 精品一区二区三区的国产在线播放| 欧美sm美女调教| 欧美亚洲丝袜传媒另类| 国产激情视频一区二区在线观看| 欧美高清在线视频| 在线成人免费观看| 成人h精品动漫一区二区三区| 亚洲综合一二区| 国产日韩视频一区二区三区| 欧美猛男gaygay网站| 成人精品视频一区二区三区 | 日本网站在线观看一区二区三区 | 亚洲欧美福利一区二区| 精品剧情v国产在线观看在线| 欧美性极品少妇| 91成人在线免费观看| k8久久久一区二区三区| 精品一区二区三区日韩| 一本久久a久久精品亚洲| 久久久国产精品不卡| 欧美一区二区三区日韩视频| 欧美性xxxxx极品少妇| 色老汉av一区二区三区| 91福利国产精品| 色成人在线视频| 91久久久免费一区二区| 91久久精品国产91性色tv| 国产精品水嫩水嫩| 国产美女视频一区| 欧美激情一区二区三区蜜桃视频 | 亚洲天堂福利av| 国产成人精品三级麻豆| 国产女主播视频一区二区| 国产在线精品一区二区三区不卡 | 一卡二卡欧美日韩| 日韩高清国产一区在线| 国产精品一级在线| 欧美视频三区在线播放| 久久免费美女视频| 成人欧美一区二区三区视频网页| 亚洲成人高清在线| 国产麻豆视频精品| 欧美日本乱大交xxxxx| 国产亚洲精久久久久久| 亚洲成av人片一区二区梦乃 | 欧美一区二区三区白人| 中文字幕一区二区三区在线观看| 亚洲国产视频a| 91在线精品一区二区| 日韩一区二区三区电影| 亚洲黄色免费网站| 国产成人精品网址| 久久久五月婷婷| 久久国产人妖系列| 欧美一级电影网站| 亚洲成人先锋电影| 欧美三级中文字| 亚洲狠狠爱一区二区三区| 成人国产在线观看| 国产精品网站导航| 成人晚上爱看视频| 亚洲欧洲韩国日本视频| 色综合天天综合给合国产| 欧美激情一区二区三区四区| 成人网页在线观看| 亚洲免费观看高清完整| 欧洲一区在线观看| 婷婷久久综合九色国产成人| 日韩亚洲欧美中文三级| 韩国v欧美v亚洲v日本v| 国产精品美女一区二区三区| 99久久综合精品| 青青草国产精品97视觉盛宴| 精品女同一区二区| 色欲综合视频天天天|