📄 apr__thread__proc_8h-source.html
字号:
00450 <span class="comment"> */</span>
00451 APR_DECLARE(apr_status_t) apr_procattr_dir_set(apr_procattr_t *attr,
00452 const <span class="keywordtype">char</span> *dir);
00453 <span class="comment"></span>
00454 <span class="comment">/**</span>
00455 <span class="comment"> * Set what type of command the child process will call.</span>
00456 <span class="comment"> * @param attr The procattr we care about. </span>
00457 <span class="comment"> * @param cmd The type of command. One of:</span>
00458 <span class="comment"> * <PRE></span>
00459 <span class="comment"> * APR_SHELLCMD -- Anything that the shell can handle</span>
00460 <span class="comment"> * APR_PROGRAM -- Executable program (default) </span>
00461 <span class="comment"> * APR_PROGRAM_ENV -- Executable program, copy environment</span>
00462 <span class="comment"> * APR_PROGRAM_PATH -- Executable program on PATH, copy env</span>
00463 <span class="comment"> * </PRE></span>
00464 <span class="comment"> */</span>
00465 APR_DECLARE(apr_status_t) apr_procattr_cmdtype_set(apr_procattr_t *attr,
00466 apr_cmdtype_e cmd);
00467 <span class="comment"></span>
00468 <span class="comment">/**</span>
00469 <span class="comment"> * Determine if the child should start in detached state.</span>
00470 <span class="comment"> * @param attr The procattr we care about. </span>
00471 <span class="comment"> * @param detach Should the child start in detached state? Default is no. </span>
00472 <span class="comment"> */</span>
00473 APR_DECLARE(apr_status_t) apr_procattr_detach_set(apr_procattr_t *attr,
00474 apr_int32_t detach);
00475
00476 #if APR_HAVE_STRUCT_RLIMIT<span class="comment"></span>
00477 <span class="comment">/**</span>
00478 <span class="comment"> * Set the Resource Utilization limits when starting a new process.</span>
00479 <span class="comment"> * @param attr The procattr we care about. </span>
00480 <span class="comment"> * @param what Which limit to set, one of:</span>
00481 <span class="comment"> * <PRE></span>
00482 <span class="comment"> * APR_LIMIT_CPU</span>
00483 <span class="comment"> * APR_LIMIT_MEM</span>
00484 <span class="comment"> * APR_LIMIT_NPROC</span>
00485 <span class="comment"> * APR_LIMIT_NOFILE</span>
00486 <span class="comment"> * </PRE></span>
00487 <span class="comment"> * @param limit Value to set the limit to.</span>
00488 <span class="comment"> */</span>
00489 APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr,
00490 apr_int32_t what,
00491 struct rlimit *limit);
00492 #endif
00493 <span class="comment"></span>
00494 <span class="comment">/**</span>
00495 <span class="comment"> * Specify an error function to be called in the child process if APR</span>
00496 <span class="comment"> * encounters an error in the child prior to running the specified program.</span>
00497 <span class="comment"> * @param attr The procattr describing the child process to be created.</span>
00498 <span class="comment"> * @param errfn The function to call in the child process.</span>
00499 <span class="comment"> * @remark At the present time, it will only be called from apr_proc_create()</span>
00500 <span class="comment"> * on platforms where fork() is used. It will never be called on other</span>
00501 <span class="comment"> * platforms, on those platforms apr_proc_create() will return the error</span>
00502 <span class="comment"> * in the parent process rather than invoke the callback in the now-forked</span>
00503 <span class="comment"> * child process.</span>
00504 <span class="comment"> */</span>
00505 APR_DECLARE(apr_status_t) apr_procattr_child_errfn_set(apr_procattr_t *attr,
00506 apr_child_errfn_t *errfn);
00507 <span class="comment"></span>
00508 <span class="comment">/**</span>
00509 <span class="comment"> * Specify that apr_proc_create() should do whatever it can to report</span>
00510 <span class="comment"> * failures to the caller of apr_proc_create(), rather than find out in</span>
00511 <span class="comment"> * the child.</span>
00512 <span class="comment"> * @param attr The procattr describing the child process to be created.</span>
00513 <span class="comment"> * @param chk Flag to indicate whether or not extra work should be done</span>
00514 <span class="comment"> * to try to report failures to the caller.</span>
00515 <span class="comment"> * @remark This flag only affects apr_proc_create() on platforms where</span>
00516 <span class="comment"> * fork() is used. This leads to extra overhead in the calling</span>
00517 <span class="comment"> * process, but that may help the application handle such</span>
00518 <span class="comment"> * errors more gracefully.</span>
00519 <span class="comment"> */</span>
00520 APR_DECLARE(apr_status_t) apr_procattr_error_check_set(apr_procattr_t *attr,
00521 apr_int32_t chk);
00522 <span class="comment"></span>
00523 <span class="comment">/**</span>
00524 <span class="comment"> * Determine if the child should start in its own address space or using the </span>
00525 <span class="comment"> * current one from its parent</span>
00526 <span class="comment"> * @param attr The procattr we care about. </span>
00527 <span class="comment"> * @param addrspace Should the child start in its own address space? Default</span>
00528 <span class="comment"> * is no on NetWare and yes on other platforms.</span>
00529 <span class="comment"> */</span>
00530 APR_DECLARE(apr_status_t) apr_procattr_addrspace_set(apr_procattr_t *attr,
00531 apr_int32_t addrspace);
00532 <span class="comment"></span>
00533 <span class="comment">/**</span>
00534 <span class="comment"> * Set the username used for running process</span>
00535 <span class="comment"> * @param attr The procattr we care about. </span>
00536 <span class="comment"> * @param username The username used</span>
00537 <span class="comment"> * @param password User password if needed. Password is needed on WIN32</span>
00538 <span class="comment"> * or any other platform having</span>
00539 <span class="comment"> * APR_PROCATTR_USER_SET_REQUIRES_PASSWORD set.</span>
00540 <span class="comment"> */</span>
00541 APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr,
00542 const <span class="keywordtype">char</span> *username,
00543 const <span class="keywordtype">char</span> *password);
00544 <span class="comment"></span>
00545 <span class="comment">/**</span>
00546 <span class="comment"> * Set the group used for running process</span>
00547 <span class="comment"> * @param attr The procattr we care about. </span>
00548 <span class="comment"> * @param groupname The group name used</span>
00549 <span class="comment"> */</span>
00550 APR_DECLARE(apr_status_t) apr_procattr_group_set(apr_procattr_t *attr,
00551 const <span class="keywordtype">char</span> *groupname);
00552
00553
00554 #if APR_HAS_FORK<span class="comment"></span>
00555 <span class="comment">/**</span>
00556 <span class="comment"> * This is currently the only non-portable call in APR. This executes </span>
00557 <span class="comment"> * a standard unix fork.</span>
00558 <span class="comment"> * @param proc The resulting process handle. </span>
00559 <span class="comment"> * @param cont The pool to use. </span>
00560 <span class="comment"> * @remark returns APR_INCHILD for the child, and APR_INPARENT for the parent</span>
00561 <span class="comment"> * or an error.</span>
00562 <span class="comment"> */</span>
00563 APR_DECLARE(apr_status_t) apr_proc_fork(<a class="code" href="structapr__proc__t.html">apr_proc_t</a> *proc, apr_pool_t *cont);
00564 #endif
00565 <span class="comment"></span>
00566 <span class="comment">/**</span>
00567 <span class="comment"> * Create a new process and execute a new program within that process.</span>
00568 <span class="comment"> * @param new_proc The resulting process handle.</span>
00569 <span class="comment"> * @param progname The program to run </span>
00570 <span class="comment"> * @param args the arguments to pass to the new program. The first </span>
00571 <span class="comment"> * one should be the program name.</span>
00572 <span class="comment"> * @param env The new environment table for the new process. This </span>
00573 <span class="comment"> * should be a list of NULL-terminated strings. This argument</span>
00574 <span class="comment"> * is ignored for APR_PROGRAM_ENV, APR_PROGRAM_PATH, and</span>
00575 <span class="comment"> * APR_SHELLCMD_ENV types of commands.</span>
00576 <span class="comment"> * @param attr the procattr we should use to determine how to create the new</span>
00577 <span class="comment"> * process</span>
00578 <span class="comment"> * @param pool The pool to use.</span>
00579 <span class="comment"> * @note This function returns without waiting for the new process to terminate;</span>
00580 <span class="comment"> * use apr_proc_wait for that.</span>
00581 <span class="comment"> */</span>
00582 APR_DECLARE(apr_status_t) apr_proc_create(<a class="code" href="structapr__proc__t.html">apr_proc_t</a> *new_proc,
00583 const <span class="keywordtype">char</span> *progname,
00584 const <span class="keywordtype">char</span> * const *args,
00585 const <span class="keywordtype">char</span> * const *env,
00586 apr_procattr_t *attr,
00587 apr_pool_t *pool);
00588 <span class="comment"></span>
00589 <span class="comment">/**</span>
00590 <span class="comment"> * Wait for a child process to die</span>
00591 <span class="comment"> * @param proc The process handle that corresponds to the desired child process </span>
00592 <span class="comment"> * @param exitcode The returned exit status of the child, if a child process </span>
00593 <span class="comment"> * dies, or the signal that caused the child to die.</span>
00594 <span class="comment"> * On platforms that don't support obtaining this information, </span>
00595 <span class="comment"> * the status parameter will be returned as APR_ENOTIMPL.</span>
00596 <span class="comment"> * @param exitwhy Why the child died, the bitwise or of:</span>
00597 <span class="comment"> * <PRE></span>
00598 <span class="comment"> * APR_PROC_EXIT -- process terminated normally</span>
00599 <span class="comment"> * APR_PROC_SIGNAL -- process was killed by a signal</span>
00600 <span class="comment"> * APR_PROC_SIGNAL_CORE -- process was killed by a signal, and</span>
00601 <span class="comment"> * generated a core dump.</span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -