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

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

?? library_23.html

?? Glibc的中文手冊
?? HTML
?? 第 1 頁 / 共 3 頁
字號:
<DD>This constant (with value <CODE>0</CODE>) specifies that <CODE>waitpid</CODE> should
return status information about any child process in the same process
group as the calling process.
</DL>
<P>
These symbolic constants are defined as flags for the <VAR>options</VAR>
argument to the <CODE>waitpid</CODE> function.  You can bitwise-OR the flags
together to obtain a value to use as the argument.
<P>
<DL COMPACT>
<DT><CODE>WNOHANG</CODE>
<DD><P>
This flag specifies that <CODE>waitpid</CODE> should return immediately
instead of waiting, if there is no child process ready to be noticed.
<P>
<DT><CODE>WUNTRACED</CODE>
<DD><P>
This flag specifies that <CODE>waitpid</CODE> should report the status of any
child processes that have been stopped as well as those that have
terminated.
</DL>
<P>
<A NAME="IDX1716"></A>
<U>Function:</U> pid_t <B>wait</B> <I>(int *<VAR>status_ptr</VAR>)</I><P>
This is a simplified version of <CODE>waitpid</CODE>, and is used to wait
until any one child process terminates.  The call:
<P>
<PRE>
wait (&#38;status)
</PRE>
<P>
is exactly equivalent to:
<P>
<PRE>
waitpid (-1, &#38;status, 0)
</PRE>
<P>
Here's an example of how to use <CODE>waitpid</CODE> to get the status from
all child processes that have terminated, without ever waiting.  This
function is designed to be a handler for <CODE>SIGCHLD</CODE>, the signal that
indicates that at least one child process has terminated.
<P>
<PRE>
void
sigchld_handler (int signum)
{
  int pid;
  int status;
  while (1)
    {
      pid = waitpid (WAIT_ANY, &#38;status, WNOHANG);
      if (pid &#60; 0)
        {
          perror ("waitpid");
          break;
        }
      if (pid == 0)
        break;
      notice_termination (pid, status);
    }
}
</PRE>
<P>
<H2><A NAME="SEC408" HREF="library_toc.html#SEC408" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC408">Process Completion Status</A></H2>
<P>
If the exit status value (see section <A HREF="library_22.html#SEC395" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_22.html#SEC395">Program Termination</A>) of the child
process is zero, then the status value reported by <CODE>waitpid</CODE> or
<CODE>wait</CODE> is also zero.  You can test for other kinds of information
encoded in the returned status value using the following macros.
These macros are defined in the header file <TT>`sys/wait.h'</TT>.
<A NAME="IDX1717"></A>
<P>
<A NAME="IDX1718"></A>
<U>Macro:</U> int <B>WIFEXITED</B> <I>(int <VAR>status</VAR>)</I><P>
This macro returns a nonzero value if the child process terminated
normally with <CODE>exit</CODE> or <CODE>_exit</CODE>.
<P>
<A NAME="IDX1719"></A>
<U>Macro:</U> int <B>WEXITSTATUS</B> <I>(int <VAR>status</VAR>)</I><P>
If <CODE>WIFEXITED</CODE> is true of <VAR>status</VAR>, this macro returns the
low-order 8 bits of the exit status value from the child process.
See section <A HREF="library_22.html#SEC397" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_22.html#SEC397">Exit Status</A>.
<P>
<A NAME="IDX1720"></A>
<U>Macro:</U> int <B>WIFSIGNALED</B> <I>(int <VAR>status</VAR>)</I><P>
This macro returns a nonzero value if the child process terminated
because it received a signal that was not handled.
See section <A HREF="library_21.html#SEC330" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_21.html#SEC330">Signal Handling</A>.
<P>
<A NAME="IDX1721"></A>
<U>Macro:</U> int <B>WTERMSIG</B> <I>(int <VAR>status</VAR>)</I><P>
If <CODE>WIFSIGNALED</CODE> is true of <VAR>status</VAR>, this macro returns the
signal number of the signal that terminated the child process.
<P>
<A NAME="IDX1722"></A>
<U>Macro:</U> int <B>WCOREDUMP</B> <I>(int <VAR>status</VAR>)</I><P>
This macro returns a nonzero value if the child process terminated
and produced a core dump.
<P>
<A NAME="IDX1723"></A>
<U>Macro:</U> int <B>WIFSTOPPED</B> <I>(int <VAR>status</VAR>)</I><P>
This macro returns a nonzero value if the child process is stopped.
<P>
<A NAME="IDX1724"></A>
<U>Macro:</U> int <B>WSTOPSIG</B> <I>(int <VAR>status</VAR>)</I><P>
If <CODE>WIFSTOPPED</CODE> is true of <VAR>status</VAR>, this macro returns the
signal number of the signal that caused the child process to stop.
<P>
<H2><A NAME="SEC409" HREF="library_toc.html#SEC409" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC409">BSD Process Wait Functions</A></H2>
<P>
The GNU library also provides these related facilities for compatibility
with BSD Unix.  BSD uses the <CODE>union wait</CODE> data type to represent
status values rather than an <CODE>int</CODE>.  The two representations are
actually interchangeable; they describe the same bit patterns.  The GNU
C Library defines macros such as <CODE>WEXITSTATUS</CODE> so that they will
work on either kind of object, and the <CODE>wait</CODE> function is defined
to accept either type of pointer as its <VAR>status_ptr</VAR> argument.
<P>
These functions are declared in <TT>`sys/wait.h'</TT>.
<A NAME="IDX1725"></A>
<P>
<A NAME="IDX1726"></A>
<U>Data Type:</U> <B>union wait</B><P>
This data type represents program termination status values.  It has
the following members:
<P>
<DL COMPACT>
<DT><CODE>int w_termsig</CODE>
<DD>This member is equivalent to the <CODE>WTERMSIG</CODE> macro.
<P>
<DT><CODE>int w_coredump</CODE>
<DD>This member is equivalent to the <CODE>WCOREDUMP</CODE> macro.
<P>
<DT><CODE>int w_retcode</CODE>
<DD>This member is equivalent to the <CODE>WEXISTATUS</CODE> macro.
<P>
<DT><CODE>int w_stopsig</CODE>
<DD>This member is equivalent to the <CODE>WSTOPSIG</CODE> macro.
</DL>
<P>
Instead of accessing these members directly, you should use the
equivalent macros.
<P>
<A NAME="IDX1727"></A>
<U>Function:</U> pid_t <B>wait3</B> <I>(union wait *<VAR>status_ptr</VAR>, int <VAR>options</VAR>, struct rusage *<VAR>usage</VAR>)</I><P>
If <VAR>usage</VAR> is a null pointer, <CODE>wait3</CODE> is equivalent to
<CODE>waitpid (-1, <VAR>status_ptr</VAR>, <VAR>options</VAR>)</CODE>.
<P>
If <VAR>usage</VAR> is not null, <CODE>wait3</CODE> stores usage figures for the
child process in <CODE>*<VAR>rusage</VAR></CODE> (but only if the child has
terminated, not if it has stopped).  See section <A HREF="library_19.html#SEC323" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_19.html#SEC323">Resource Usage</A>.
<P>
<A NAME="IDX1728"></A>
<U>Function:</U> pid_t <B>wait4</B> <I>(pid_t <VAR>pid</VAR>, union wait *<VAR>status_ptr</VAR>, int <VAR>options</VAR>, struct rusage *<VAR>usage</VAR>)</I><P>
If <VAR>usage</VAR> is a null pointer, <CODE>wait4</CODE> is equivalent to
<CODE>waitpid (<VAR>pid</VAR>, <VAR>status_ptr</VAR>, <VAR>options</VAR>)</CODE>.
<P>
If <VAR>usage</VAR> is not null, <CODE>wait4</CODE> stores usage figures for the
child process in <CODE>*<VAR>rusage</VAR></CODE> (but only if the child has
terminated, not if it has stopped).  See section <A HREF="library_19.html#SEC323" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_19.html#SEC323">Resource Usage</A>.
<P>
<H2><A NAME="SEC410" HREF="library_toc.html#SEC410" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC410">Process Creation Example</A></H2>
<P>
Here is an example program showing how you might write a function
similar to the built-in <CODE>system</CODE>.  It executes its <VAR>command</VAR>
argument using the equivalent of <SAMP>`sh -c <VAR>command</VAR>'</SAMP>.
<P>
<PRE>
#include &#60;stddef.h&#62;
#include &#60;stdlib.h&#62;
#include &#60;unistd.h&#62;
#include &#60;sys/types.h&#62;
#include &#60;sys/wait.h&#62;

/* Execute the command using this shell program.  */
#define SHELL "/bin/sh"

int 
my_system (const char *command)
{
  int status;
  pid_t pid;

  pid = fork ();
  if (pid == 0)
    {
      /* This is the child process.  Execute the shell command. */
      execl (SHELL, SHELL, "-c", command, NULL);
      _exit (EXIT_FAILURE);
    }
  else if (pid &#60; 0)
    /* The fork failed.  Report failure.  */
    status = -1;
  else
    /* This is the parent process.  Wait for the child to complete.  */
    if (waitpid (pid, &#38;status, 0) != pid)
      status = -1;
  return status;
}
</PRE>
<P>
There are a couple of things you should pay attention to in this
example.
<P>
Remember that the first <CODE>argv</CODE> argument supplied to the program
represents the name of the program being executed.  That is why, in the
call to <CODE>execl</CODE>, <CODE>SHELL</CODE> is supplied once to name the program
to execute and a second time to supply a value for <CODE>argv[0]</CODE>.  
<P>
The <CODE>execl</CODE> call in the child process doesn't return if it is
successful.  If it fails, you must do something to make the child
process terminate.  Just returning a bad status code with <CODE>return</CODE>
would leave two processes running the original program.  Instead, the
right behavior is for the child process to report failure to its parent
process.
<P>
Call <CODE>_exit</CODE> to accomplish this.  The reason for using <CODE>_exit</CODE>
instead of <CODE>exit</CODE> is to avoid flushing fully buffered streams such
as <CODE>stdout</CODE>.  The buffers of these streams probably contain data
that was copied from the parent process by the <CODE>fork</CODE>, data that
will be output eventually by the parent process.  Calling <CODE>exit</CODE> in
the child would output the data twice.  See section <A HREF="library_22.html#SEC400" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_22.html#SEC400">Termination Internals</A>.
<P>Go to the <A HREF="library_22.html" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_22.html">previous</A>, <A HREF="library_24.html" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_24.html">next</A> section.<P>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆精品一区二区综合av| 久久婷婷一区二区三区| 夜夜嗨av一区二区三区中文字幕| 成人激情免费网站| 亚洲精品免费在线| 欧美日韩你懂得| 美女视频第一区二区三区免费观看网站| 欧美视频日韩视频| 日本午夜一本久久久综合| 日韩精品一区二区三区在线| 国产毛片精品视频| 日韩一区在线免费观看| 色www精品视频在线观看| 亚洲电影在线播放| 日韩精品中文字幕在线一区| 免费高清成人在线| 国产婷婷一区二区| 91久久精品国产91性色tv| 亚洲bt欧美bt精品| 国产亚洲综合色| 99精品视频在线播放观看| 亚洲成av人影院| 精品久久久久久久久久久久久久久| 国产99久久精品| 亚洲永久免费av| 精品国产一区二区三区不卡| 国产不卡视频在线播放| 亚洲一区二区精品视频| 欧美电视剧免费全集观看| 国产69精品久久777的优势| 亚洲一区二区不卡免费| 久久蜜臀中文字幕| 欧美性色黄大片| 国内精品嫩模私拍在线| 一区二区三区小说| 欧美精品一区二区久久久| 99国产精品99久久久久久| 蜜桃av一区二区三区电影| 国产精品国产成人国产三级 | 91麻豆精品国产91久久久使用方法| 国内精品免费**视频| 亚洲男帅同性gay1069| 26uuu亚洲综合色| 国产精品久久夜| 不卡区在线中文字幕| 麻豆成人免费电影| 亚洲黄色片在线观看| 26uuu欧美| 欧美一区2区视频在线观看| gogo大胆日本视频一区| 麻豆国产精品一区二区三区| 一区二区在线看| 欧美高清在线一区| 精品久久久久久久久久久院品网| 欧美性做爰猛烈叫床潮| 99精品偷自拍| 成人黄页在线观看| 国产麻豆一精品一av一免费 | 欧美一区二区精品| 欧美亚洲综合久久| 99国产精品国产精品久久| 韩国精品主播一区二区在线观看| 亚洲第一在线综合网站| 夜夜嗨av一区二区三区网页| 中文乱码免费一区二区| 亚洲精品一区二区精华| 欧美一区二区三区思思人| 欧美日韩在线播放一区| 91国产丝袜在线播放| 成人91在线观看| av一区二区三区| 成人高清伦理免费影院在线观看| 精品中文字幕一区二区小辣椒| 日韩**一区毛片| 视频一区中文字幕| 婷婷激情综合网| 日韩av一区二区在线影视| 五月婷婷激情综合| 日韩精品一二三| 男女男精品视频| 久久成人免费日本黄色| 久久99精品国产麻豆婷婷洗澡| 日韩精彩视频在线观看| 日韩av中文字幕一区二区| 日韩vs国产vs欧美| 狠狠网亚洲精品| 国产一区高清在线| 高清久久久久久| 99国产精品久久久久久久久久久| 99国产精品国产精品毛片| 91网站在线观看视频| 在线亚洲免费视频| 制服丝袜激情欧洲亚洲| 欧美一级二级在线观看| 久久久蜜臀国产一区二区| 欧美精彩视频一区二区三区| 国产精品欧美久久久久一区二区| 综合色中文字幕| 亚洲v日本v欧美v久久精品| 免费观看日韩电影| 国产成人福利片| 91色视频在线| 欧美一区二区三区啪啪| 久久午夜羞羞影院免费观看| 国产视频一区二区三区在线观看| 国产精品国产三级国产aⅴ原创| 亚洲综合视频在线观看| 青青青伊人色综合久久| 国产成人一区在线| 欧洲av一区二区嗯嗯嗯啊| 欧美大度的电影原声| 国产日韩欧美精品综合| 一区二区三区不卡在线观看| 蜜臀91精品一区二区三区| 国产成人免费视频网站高清观看视频 | 中文字幕一区免费在线观看 | 视频一区在线播放| 国产成a人无v码亚洲福利| 一本一本大道香蕉久在线精品 | 欧美三级三级三级| 亚洲精品一区二区三区福利| 亚洲色图视频网| 久久国产剧场电影| 色999日韩国产欧美一区二区| 日韩欧美自拍偷拍| 亚洲精品视频在线观看免费| 久久精品国产一区二区三| 91色婷婷久久久久合中文| 久久综合国产精品| 无码av免费一区二区三区试看| 成人综合在线视频| 欧美一个色资源| 亚洲一二三专区| 成人动漫一区二区在线| 日韩一区二区免费高清| 一区二区三区欧美视频| 国产一区二区三区av电影| 欧美日韩一区在线| 亚洲视频一区二区在线观看| 久久99精品国产91久久来源| 9人人澡人人爽人人精品| 日韩三级视频在线看| 国产精品高清亚洲| 国产jizzjizz一区二区| 69堂成人精品免费视频| 国产精品卡一卡二卡三| 天堂在线亚洲视频| 色综合色狠狠天天综合色| 精品日韩欧美在线| 亚洲一区免费观看| 亚洲www啪成人一区二区麻豆| 91首页免费视频| 日本一区二区成人| 久久电影网电视剧免费观看| 色综合久久综合| 国产精品家庭影院| 国产一区二区久久| 欧美肥胖老妇做爰| 亚洲午夜在线观看视频在线| 色综合天天狠狠| 国产精品久久国产精麻豆99网站 | 免费的成人av| 白白色 亚洲乱淫| 精品国产乱码久久久久久蜜臀| 亚洲午夜久久久久| 色噜噜狠狠一区二区三区果冻| 91精品国产麻豆国产自产在线| 亚洲成人激情综合网| 99re在线精品| 国产精品久久久久9999吃药| 韩国毛片一区二区三区| 久久综合色综合88| 老司机免费视频一区二区三区| 欧美精品777| 国产精品福利在线播放| 色94色欧美sute亚洲线路一久| 国产精品国产三级国产普通话三级 | 一区二区欧美在线观看| 97精品国产露脸对白| 国产精品美女www爽爽爽| 高潮精品一区videoshd| 日本一区二区成人在线| 成人亚洲一区二区一| 中文字幕的久久| 99久久精品国产一区二区三区 | 欧美日韩一区二区欧美激情| 亚洲老妇xxxxxx| 91视频免费看| 亚洲国产欧美在线人成| 欧美日韩精品综合在线| 亚洲国产成人tv| 91精品综合久久久久久| 日韩国产高清影视| 日韩欧美美女一区二区三区| 极品少妇xxxx精品少妇偷拍| 精品国精品国产尤物美女| 精品一区二区三区在线观看| 久久久久亚洲综合| 高清av一区二区| 亚洲精品中文在线影院|