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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? library_21.html

?? Glibc的中文手冊
?? HTML
?? 第 1 頁 / 共 5 頁
字號:
<DD><CODE>SIG_DFL</CODE> specifies the default action for the particular signal.
The default actions for various kinds of signals are stated in
section <A HREF="library_21.html#SEC335" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_21.html#SEC335">Standard Signals</A>.
<P>
<A NAME="IDX1543"></A>
<A NAME="IDX1544"></A>
<DT><CODE>SIG_IGN</CODE>
<DD><CODE>SIG_IGN</CODE> specifies that the signal should be ignored.
<P>
Your program generally should not ignore signals that represent serious
events or that are normally used to request termination.  You cannot
ignore the <CODE>SIGKILL</CODE> or <CODE>SIGSTOP</CODE> signals at all.  You can
ignore program error signals like <CODE>SIGSEGV</CODE>, but ignoring the error
won't enable the program to continue executing meaningfully.  Ignoring
user requests such as <CODE>SIGINT</CODE>, <CODE>SIGQUIT</CODE>, and <CODE>SIGTSTP</CODE>
is unfriendly.
<P>
When you do not wish signals to be delivered during a certain part of
the program, the thing to do is to block them, not ignore them.
See section <A HREF="library_21.html#SEC368" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_21.html#SEC368">Blocking Signals</A>.
<P>
<DT><CODE><VAR>handler</VAR></CODE>
<DD>Supply the address of a handler function in your program, to specify
running this handler as the way to deliver the signal.
<P>
For more information about defining signal handler functions,
see section <A HREF="library_21.html#SEC351" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_21.html#SEC351">Defining Signal Handlers</A>.
</DL>
<P>
If you set the action for a signal to <CODE>SIG_IGN</CODE>, or if you set it
to <CODE>SIG_DFL</CODE> and the default action is to ignore that signal, then
any pending signals of that type are discarded (even if they are
blocked).  Discarding the pending signals means that they will never be
delivered, not even if you subsequently specify another action and
unblock this kind of signal.
<P>
The <CODE>signal</CODE> function returns the action that was previously in
effect for the specified <VAR>signum</VAR>.  You can save this value and
restore it later by calling <CODE>signal</CODE> again.
<P>
If <CODE>signal</CODE> can't honor the request, it returns <CODE>SIG_ERR</CODE>
instead.  The following <CODE>errno</CODE> error conditions are defined for
this function:
<P>
<DL COMPACT>
<DT><CODE>EINVAL</CODE>
<DD>You specified an invalid <VAR>signum</VAR>; or you tried to ignore or provide
a handler for <CODE>SIGKILL</CODE> or <CODE>SIGSTOP</CODE>.
</DL>
<P>
Here is a simple example of setting up a handler to delete temporary
files when certain fatal signals happen:
<P>
<PRE>
#include &#60;signal.h&#62;

void
termination_handler (int signum)
{
  struct temp_file *p;

  for (p = temp_file_list; p; p = p-&#62;next)
    unlink (p-&#62;name);
}

int
main (void)
{
  ...
  if (signal (SIGINT, termination_handler) == SIG_IGN)
    signal (SIGINT, SIG_IGN);
  if (signal (SIGHUP, termination_handler) == SIG_IGN)
    signal (SIGHUP, SIG_IGN);
  if (signal (SIGTERM, termination_handler) == SIG_IGN)
    signal (SIGTERM, SIG_IGN);
  ...
}
</PRE>
<P>
Note how if a given signal was previously set to be ignored, this code
avoids altering that setting.  This is because non-job-control shells
often ignore certain signals when starting children, and it is important
for the children to respect this.
<P>
We do not handle <CODE>SIGQUIT</CODE> or the program error signals in this
example because these are designed to provide information for debugging
(a core dump), and the temporary files may give useful information.
<P>
<A NAME="IDX1545"></A>
<U>Function:</U> sighandler_t <B>ssignal</B> <I>(int <VAR>signum</VAR>, sighandler_t <VAR>action</VAR>)</I><P>
The <CODE>ssignal</CODE> function does the same thing as <CODE>signal</CODE>; it is
provided only for compatibility with SVID.
<P>
<A NAME="IDX1546"></A>
<U>Macro:</U> sighandler_t <B>SIG_ERR</B><P>
The value of this macro is used as the return value from <CODE>signal</CODE>
to indicate an error.
<P>
<A NAME="IDX1547"></A>
<H3><A NAME="SEC346" HREF="library_toc.html#SEC346" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC346">Advanced Signal Handling</A></H3>
<P>
The <CODE>sigaction</CODE> function has the same basic effect as
<CODE>signal</CODE>: to specify how a signal should be handled by the process.
However, <CODE>sigaction</CODE> offers more control, at the expense of more
complexity.  In particular, <CODE>sigaction</CODE> allows you to specify
additional flags to control when the signal is generated and how the
handler is invoked.
<P>
The <CODE>sigaction</CODE> function is declared in <TT>`signal.h'</TT>.
<A NAME="IDX1548"></A>
<P>
<A NAME="IDX1549"></A>
<U>Data Type:</U> <B>struct sigaction</B><P>
Structures of type <CODE>struct sigaction</CODE> are used in the
<CODE>sigaction</CODE> function to specify all the information about how to
handle a particular signal.  This structure contains at least the
following members:
<P>
<DL COMPACT>
<DT><CODE>sighandler_t sa_handler</CODE>
<DD>This is used in the same way as the <VAR>action</VAR> argument to the
<CODE>signal</CODE> function.  The value can be <CODE>SIG_DFL</CODE>,
<CODE>SIG_IGN</CODE>, or a function pointer.  See section <A HREF="library_21.html#SEC345" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_21.html#SEC345">Basic Signal Handling</A>.
<P>
<DT><CODE>sigset_t sa_mask</CODE>
<DD>This specifies a set of signals to be blocked while the handler runs.
Blocking is explained in section <A HREF="library_21.html#SEC373" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_21.html#SEC373">Blocking Signals for a Handler</A>.  Note that the
signal that was delivered is automatically blocked by default before its
handler is started; this is true regardless of the value in
<CODE>sa_mask</CODE>.  If you want that signal not to be blocked within its
handler, you must write code in the handler to unblock it.
<P>
<DT><CODE>int sa_flags</CODE>
<DD>This specifies various flags which can affect the behavior of 
the signal.  These are described in more detail in section <A HREF="library_21.html#SEC349" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_21.html#SEC349">Flags for <CODE>sigaction</CODE></A>.
</DL>
<P>
<A NAME="IDX1550"></A>
<U>Function:</U> int <B>sigaction</B> <I>(int <VAR>signum</VAR>, const struct sigaction *<VAR>action</VAR>, struct sigaction *<VAR>old_action</VAR>)</I><P>
The <VAR>action</VAR> argument is used to set up a new action for the signal
<VAR>signum</VAR>, while the <VAR>old_action</VAR> argument is used to return
information about the action previously associated with this symbol.
(In other words, <VAR>old_action</VAR> has the same purpose as the
<CODE>signal</CODE> function's return value--you can check to see what the
old action in effect for the signal was, and restore it later if you
want.)
<P>
Either <VAR>action</VAR> or <VAR>old_action</VAR> can be a null pointer.  If
<VAR>old_action</VAR> is a null pointer, this simply suppresses the return
of information about the old action.  If <VAR>action</VAR> is a null pointer,
the action associated with the signal <VAR>signum</VAR> is unchanged; this
allows you to inquire about how a signal is being handled without changing
that handling.
<P>
The return value from <CODE>sigaction</CODE> is zero if it succeeds, and
<CODE>-1</CODE> on failure.  The following <CODE>errno</CODE> error conditions are
defined for this function:
<P>
<DL COMPACT>
<DT><CODE>EINVAL</CODE>
<DD>The <VAR>signum</VAR> argument is not valid, or you are trying to
trap or ignore <CODE>SIGKILL</CODE> or <CODE>SIGSTOP</CODE>.
</DL>
<P>
<H3><A NAME="SEC347" HREF="library_toc.html#SEC347" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC347">Interaction of <CODE>signal</CODE> and <CODE>sigaction</CODE></A></H3>
<P>
It's possible to use both the <CODE>signal</CODE> and <CODE>sigaction</CODE>
functions within a single program, but you have to be careful because
they can interact in slightly strange ways.
<P>
The <CODE>sigaction</CODE> function specifies more information than the
<CODE>signal</CODE> function, so the return value from <CODE>signal</CODE> cannot
express the full range of <CODE>sigaction</CODE> possibilities.  Therefore, if
you use <CODE>signal</CODE> to save and later reestablish an action, it may
not be able to reestablish properly a handler that was established with
<CODE>sigaction</CODE>.
<P>
To avoid having problems as a result, always use <CODE>sigaction</CODE> to
save and restore a handler if your program uses <CODE>sigaction</CODE> at all.
Since <CODE>sigaction</CODE> is more general, it can properly save and
reestablish any action, regardless of whether it was established
originally with <CODE>signal</CODE> or <CODE>sigaction</CODE>.
<P>
If you establish an action with <CODE>signal</CODE> and then examine it with
<CODE>sigaction</CODE>, the handler address that you get may not be the same
as what you specified with <CODE>signal</CODE>.  It may not even be suitable
for use as an action argument with <CODE>signal</CODE>.  But you can rely on
using it as an argument to <CODE>sigaction</CODE>.
<P>
So, you're better off using one or the other of the mechanisms
consistently within a single program.  
<P>
<STRONG>Portability Note:</STRONG> The basic <CODE>signal</CODE> function is a feature
of ANSI C, while <CODE>sigaction</CODE> is part of the POSIX.1 standard.  If
you are concerned about portability to non-POSIX systems, then you
should use the <CODE>signal</CODE> function instead.
<P>
<H3><A NAME="SEC348" HREF="library_toc.html#SEC348" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC348"><CODE>sigaction</CODE> Function Example</A></H3>
<P>
In section <A HREF="library_21.html#SEC345" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_21.html#SEC345">Basic Signal Handling</A>, we gave an example of establishing a
simple handler for termination signals using <CODE>signal</CODE>.  Here is an
equivalent example using <CODE>sigaction</CODE>:
<P>
<PRE>
#include &#60;signal.h&#62;

void
termination_handler (int signum)
{
  struct temp_file *p;

  for (p = temp_file_list; p; p = p-&#62;next)
    unlink (p-&#62;name);
}

int
main (void)
{
  ...
  struct sigaction new_action, old_action;

  /* Set up the structure to specify the new action. */
  new_action.sa_handler = termination_handler;
  sigemptyset (&#38;new_action.sa_mask);
  new_action.sa_flags = 0;

  sigaction (SIGINT, NULL, &#38;old_action);
  if (old_action.sa_handler != SIG_IGN)
    sigaction (SIGINT, &#38;new_action, NULL);
  sigaction (SIGHUP, NULL, &#38;old_action);
  if (old_action.sa_handler != SIG_IGN)
    sigaction (SIGHUP, &#38;new_action, NULL);
  sigaction (SIGTERM, NULL, &#38;old_action);
  if (old_action.sa_handler != SIG_IGN)
    sigaction (SIGTERM, &#38;new_action, NULL);
  ...
}
</PRE>
<P>
The program just loads the <CODE>new_action</CODE> structure with the desired
parameters and passes it in the <CODE>sigaction</CODE> call.  The usage of
<CODE>sigemptyset</CODE> is described later; see section <A HREF="library_21.html#SEC368" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_21.html#SEC368">Blocking Signals</A>.
<P>
As in the example using <CODE>signal</CODE>, we avoid handling signals
previously set to be ignored.  Here we can avoid altering the signal
handler even momentarily, by using the feature of <CODE>sigaction</CODE> that
lets us examine the current action without specifying a new one.
<P>
Here is another example.  It retrieves information about the current
action for <CODE>SIGINT</CODE> without changing that action.
<P>
<PRE>
struct sigaction query_action;

if (sigaction (SIGINT, NULL, &#38;query_action) &#60; 0)
  /* <CODE>sigaction</CODE> returns -1 in case of error. */ 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲蜜桃精久久久久久久| 亚洲综合一二区| 欧美一区二区啪啪| 欧美日韩情趣电影| 欧美日本一区二区三区四区| 久久久美女毛片| 亚洲精品国产a| 青青草成人在线观看| 成人综合婷婷国产精品久久 | 欧美亚洲自拍偷拍| 日韩欧美成人一区二区| 亚洲色图清纯唯美| 秋霞影院一区二区| 色综合网站在线| 26uuu亚洲婷婷狠狠天堂| 亚洲欧美一区二区三区极速播放| 蜜臀va亚洲va欧美va天堂 | 欧美videofree性高清杂交| 国产精品国产三级国产普通话99 | 久久综合久色欧美综合狠狠| 亚洲色图丝袜美腿| 免费成人av在线| 在线一区二区三区| 国产精品久久久久永久免费观看 | 亚洲精品水蜜桃| 日韩黄色片在线观看| 99久久综合99久久综合网站| 日韩免费观看2025年上映的电影| 欧美国产一区二区在线观看| 七七婷婷婷婷精品国产| 欧美日韩在线播放三区| 国产日产欧美精品一区二区三区| 日韩电影在线一区二区| 在线免费观看一区| 亚洲国产精品黑人久久久| 久久99国产精品免费| 精品国免费一区二区三区| 免费成人在线网站| 久久这里只有精品6| 国产91丝袜在线播放0| 国产精品三级久久久久三级| 99久久久久免费精品国产 | 成a人片亚洲日本久久| 国产精品国产三级国产普通话99| 成人国产精品免费| 亚洲精品写真福利| 制服丝袜av成人在线看| 日本v片在线高清不卡在线观看| 日韩视频一区二区| 国产一区二区三区四| 国产精品久久久久久久久免费丝袜 | 久久久国际精品| 国产aⅴ精品一区二区三区色成熟| 日本一二三四高清不卡| 日本电影欧美片| 美国毛片一区二区三区| 国产亚洲欧美在线| 色就色 综合激情| 日本伊人色综合网| 国产欧美精品一区二区色综合| 97精品久久久久中文字幕| 午夜影院久久久| 久久天堂av综合合色蜜桃网| 99久久99久久精品国产片果冻| 一区二区三区丝袜| 精品毛片乱码1区2区3区| jlzzjlzz欧美大全| 美女免费视频一区二区| 综合久久国产九一剧情麻豆| 欧美人与禽zozo性伦| 国产激情一区二区三区四区| 亚洲与欧洲av电影| 国产午夜亚洲精品不卡| 欧美性一二三区| 成人激情免费电影网址| 日韩影视精彩在线| 亚洲欧美在线视频观看| 欧美一级片在线看| 一本一道久久a久久精品综合蜜臀| 免费国产亚洲视频| 亚洲人成在线观看一区二区| 欧美大白屁股肥臀xxxxxx| 色综合欧美在线视频区| 国产揄拍国内精品对白| 亚洲高清免费观看高清完整版在线观看| 久久久一区二区三区| 欧美日韩一卡二卡| 91猫先生在线| 国产精品 日产精品 欧美精品| 五月天久久比比资源色| 亚洲视频小说图片| 中文字幕精品一区二区三区精品| 欧美另类变人与禽xxxxx| 91香蕉国产在线观看软件| 国产一区二区91| 蜜桃免费网站一区二区三区| 亚洲高清中文字幕| 一区二区三区中文字幕在线观看| 精品第一国产综合精品aⅴ| 欧美老年两性高潮| 91成人免费网站| 91在线看国产| 波多野结衣91| 成人av免费在线观看| 国产成人鲁色资源国产91色综| 欧美a级一区二区| 秋霞午夜av一区二区三区| 天堂蜜桃一区二区三区 | 在线观看日韩av先锋影音电影院| 国产成人精品午夜视频免费| 国产精品一区二区三区四区| 国产在线不卡视频| 国产一区二区在线视频| 国产在线精品一区二区夜色| 精品中文字幕一区二区小辣椒| 日韩国产欧美视频| 美女视频网站黄色亚洲| 麻豆精品视频在线观看免费| 久久99蜜桃精品| 国产在线麻豆精品观看| 国产成人在线视频网站| 成人看片黄a免费看在线| 风间由美中文字幕在线看视频国产欧美| 国产永久精品大片wwwapp| 国产黄色精品视频| 成人动漫一区二区三区| 91原创在线视频| 欧美三片在线视频观看 | 日本精品一区二区三区高清| 色香蕉久久蜜桃| 欧美高清视频在线高清观看mv色露露十八| 欧美欧美午夜aⅴ在线观看| 欧美浪妇xxxx高跟鞋交| 日韩精品一区二区三区四区| 欧美精品一区二区三区蜜桃| 国产日产欧美一区二区视频| 亚洲人123区| 性做久久久久久久久| 精品在线免费观看| 国产激情视频一区二区三区欧美 | 99re免费视频精品全部| 在线精品视频免费观看| 欧美一区二区三区爱爱| 国产欧美日韩激情| 一区二区三区在线视频播放| 丝袜亚洲另类欧美| 成人免费毛片a| 91精品在线一区二区| 国产精品久久久久久久午夜片 | 一本一道久久a久久精品| 欧美日本精品一区二区三区| 国产视频亚洲色图| 亚洲成人自拍网| 成人免费视频网站在线观看| 欧美另类z0zxhd电影| 日本一区二区不卡视频| 日本欧美加勒比视频| 成人高清视频免费观看| 日韩三级精品电影久久久| 国产精品久久精品日日| 奇米一区二区三区av| 色婷婷综合视频在线观看| 久久综合色8888| 日韩精品一二三四| 91丝袜呻吟高潮美腿白嫩在线观看| 欧美美女bb生活片| 中文一区在线播放| 九九久久精品视频| 欧美视频在线不卡| 亚洲视频综合在线| 粉嫩一区二区三区性色av| 欧美日韩国产综合一区二区三区 | 国产免费久久精品| 视频在线观看一区| 欧美在线影院一区二区| 中文字幕一区二区三区不卡| 精品一区二区免费在线观看| 欧美日韩国产综合一区二区| 1024成人网色www| 懂色av一区二区三区蜜臀| 精品国产自在久精品国产| 日韩激情一二三区| 欧美日韩aaaaaa| 亚洲一区国产视频| 91日韩一区二区三区| 亚洲欧洲日本在线| 成人av在线影院| 国产精品午夜在线| 国产99精品国产| 国产日本欧美一区二区| 国产电影精品久久禁18| 久久久99精品久久| 国产在线视视频有精品| 精品国偷自产国产一区| 国产在线视频一区二区| 久久综合成人精品亚洲另类欧美| 精品一区二区在线视频| 久久亚洲二区三区| 岛国精品在线观看| 综合色天天鬼久久鬼色|