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

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

?? library_21.html

?? Glibc的中文手冊
?? HTML
?? 第 1 頁 / 共 5 頁
字號:
<!-- This HTML file has been created by texi2html 1.27
     from library.texinfo on 3 March 1994 -->

<TITLE>The GNU C Library - Signal Handling</TITLE>
<P>Go to the <A HREF="library_20.html" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_20.html">previous</A>, <A HREF="library_22.html" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_22.html">next</A> section.<P>
<H1><A NAME="SEC330" HREF="library_toc.html#SEC330" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC330">Signal Handling</A></H1>
<A NAME="IDX1452"></A>
<P>
A <DFN>signal</DFN> is a software interrupt delivered to a process.  The
operating system uses signals to report exceptional situations to an
executing program.  Some signals report errors such as references to
invalid memory addresses; others report asynchronous events, such as
disconnection of a phone line.
<P>
The GNU C library defines a variety of signal types, each for a
particular kind of event.  Some kinds of events make it inadvisable or
impossible for the program to proceed as usual, and the corresponding
signals normally abort the program.  Other kinds of signals that report
harmless events are ignored by default.
<P>
If you anticipate an event that causes signals, you can define a handler
function and tell the operating system to run it when that particular
type of signal arrives.
<P>
Finally, one process can send a signal to another process; this allows a
parent process to abort a child, or two related processes to communicate
and synchronize.
<P>
<H2><A NAME="SEC331" HREF="library_toc.html#SEC331" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC331">Basic Concepts of Signals</A></H2>
<P>
This section explains basic concepts of how signals are generated, what
happens after a signal is delivered, and how programs can handle
signals.
<P>
<H3><A NAME="SEC332" HREF="library_toc.html#SEC332" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC332">Some Kinds of Signals</A></H3>
<P>
A signal reports the occurrence of an exceptional event.  These are some
of the events that can cause (or <DFN>generate</DFN>, or <DFN>raise</DFN>) a
signal:
<P>
<UL>
<LI>
A program error such as dividing by zero or issuing an address outside
the valid range.
<P>
<LI>
A user request to interrupt or terminate the program.  Most environments
are set up to let a user suspend the program by typing <KBD>C-z</KBD>, or
terminate it with <KBD>C-c</KBD>.  Whatever key sequence is used, the
operating system sends the proper signal to interrupt the process.
<P>
<LI>
The termination of a child process.
<P>
<LI>
Expiration of a timer or alarm.
<P>
<LI>
A call to <CODE>kill</CODE> or <CODE>raise</CODE> by the same process.
<P>
<LI>
A call to <CODE>kill</CODE> from another process.  Signals are a limited but
useful form of interprocess communication.
</UL>
<P>
Each of these kinds of events (excepting explicit calls to <CODE>kill</CODE>
and <CODE>raise</CODE>) generates its own particular kind of signal.  The
various kinds of signals are listed and described in detail 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="IDX1453"></A>
<H3><A NAME="SEC333" HREF="library_toc.html#SEC333" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC333">Concepts of Signal Generation</A></H3>
<P>
In general, the events that generate signals fall into three major
categories: errors, external events, and explicit requests.
<P>
An error means that a program has done something invalid and cannot
continue execution.  But not all kinds of errors generate signals--in
fact, most do not.  For example, opening a nonexistant file is an error,
but it does not raise a signal; instead, <CODE>open</CODE> returns <CODE>-1</CODE>.
In general, errors that are necessarily associated with certain library
functions are reported by returning a value that indicates an error.
The errors which raise signals are those which can happen anywhere in
the program, not just in library calls.  These include division by zero
and invalid memory addresses.
<P>
An external event generally has to do with I/O or other processes.
These include the arrival of input, the expiration of a timer, and the
termination of a child process.
<P>
An explicit request means the use of a library function such as
<CODE>kill</CODE> whose purpose is specifically to generate a signal.
<P>
Signals may be generated <DFN>synchronously</DFN> or <DFN>asynchronously</DFN>.  A
synchronous signal pertains to a specific action in the program, and is
delivered (unless blocked) during that action.  Errors generate signals
synchronously, and so do explicit requests by a process to generate a
signal for that same process.
<P>
Asynchronous signals are generated by events outside the control of the
process that receives them.  These signals arrive at unpredictable times
during execution.  External events generate signals asynchronously, and
so do explicit requests that apply to some other process.
<P>
A given type of signal is either typically synchrous or typically
asynchronous.  For example, signals for errors are typically synchronous
because errors generate signals synchronously.  But any type of signal
can be generated synchronously or asynchronously with an explicit
request.
<P>
<A NAME="IDX1454"></A>
<A NAME="IDX1455"></A>
<A NAME="IDX1456"></A>
<H3><A NAME="SEC334" HREF="library_toc.html#SEC334" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC334">How Signals Are Delivered</A></H3>
<P>
When a signal is generated, it becomes <DFN>pending</DFN>.  Normally it
remains pending for just a short period of time and then is
<DFN>delivered</DFN> to the process that was signaled.  However, if that kind
of signal is currently <DFN>blocked</DFN>, it may remain pending
indefinitely--until signals of that kind are <DFN>unblocked</DFN>.  Once
unblocked, it will be delivered immediately.  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>.
<A NAME="IDX1457"></A>
<A NAME="IDX1458"></A>
<A NAME="IDX1459"></A>
<A NAME="IDX1460"></A>
<P>
When the signal is delivered, whether right away or after a long delay,
the <DFN>specified action</DFN> for that signal is taken.  For certain
signals, such as <CODE>SIGKILL</CODE> and <CODE>SIGSTOP</CODE>, the action is fixed,
but for most signals, the program has a choice: ignore the signal,
specify a <DFN>handler function</DFN>, or accept the <DFN>default action</DFN> for
that kind of signal.  The program specifies its choice using functions
such as <CODE>signal</CODE> or <CODE>sigaction</CODE> (see section <A HREF="library_21.html#SEC344" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_21.html#SEC344">Specifying Signal Actions</A>).  We
sometimes say that a handler <DFN>catches</DFN> the signal.  While the
handler is running, that particular signal is normally blocked.
<P>
If the specified action for a kind of signal is to ignore it, then any
such signal which is generated is discarded immediately.  This happens
even if the signal is also blocked at the time.  A signal discarded in
this way will never be delivered, not even if the program subsequently
specifies a different action for that kind of signal and then unblocks
it.
<P>
If a signal arrives which the program has neither handled nor ignored,
its <DFN>default action</DFN> takes place.  Each kind of signal has its own
default action, documented below (see 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>).  For most kinds
of signals, the default action is to terminate the process.  For certain
kinds of signals that represent "harmless" events, the default action
is to do nothing.
<P>
When a signal terminates a process, its parent process can determine the
cause of termination by examining the termination status code reported
by the <CODE>wait</CODE> or <CODE>waitpid</CODE> functions.  (This is discussed in
more detail in section <A HREF="library_23.html#SEC407" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_23.html#SEC407">Process Completion</A>.)  The information it can get
includes the fact that termination was due to a signal, and the kind of
signal involved.  If a program you run from a shell is terminated by a
signal, the shell typically prints some kind of error message.
<P>
The signals that normally represent program errors have a special
property: when one of these signals terminates the process, it also
writes a <DFN>core dump file</DFN> which records the state of the process at
the time of termination.  You can examine the core dump with a debugger
to investigate what caused the error.
<P>
If you raise a "program error" signal by explicit request, and this
terminates the process, it makes a core dump file just as if the signal
had been due directly to an error.
<P>
<A NAME="IDX1461"></A>
<A NAME="IDX1462"></A>
<H2><A NAME="SEC335" HREF="library_toc.html#SEC335" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC335">Standard Signals</A></H2>
<A NAME="IDX1463"></A>
<A NAME="IDX1464"></A>
<P>
This section lists the names for various standard kinds of signals and
describes what kind of event they mean.  Each signal name is a macro
which stands for a positive integer--the <DFN>signal number</DFN> for that
kind of signal.  Your programs should never make assumptions about the
numeric code for a particular kind of signal, but rather refer to them
always by the names defined here.  This is because the number for a
given kind of signal can vary from system to system, but the meanings of
the names are standardized and fairly uniform.
<P>
The signal names are defined in the header file <TT>`signal.h'</TT>.
<P>
<A NAME="IDX1465"></A>
<U>Macro:</U> int <B>NSIG</B><P>
The value of this symbolic constant is the total number of signals
defined.  Since the signal numbers are allocated consecutively,
<CODE>NSIG</CODE> is also one greater than the largest defined signal number.
<P>
<A NAME="IDX1466"></A>
<H3><A NAME="SEC336" HREF="library_toc.html#SEC336" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC336">Program Error Signals</A></H3>
<P>
The following signals are generated when a serious program error is
detected by the operating system or the computer itself.  In general,
all of these signals are indications that your program is seriously
broken in some way, and there's usually no way to continue the
computation which encountered the error.
<P>
Some programs handle program error signals in order to tidy up before
terminating; for example, programs that turn off echoing of terminal
input should handle program error signals in order to turn echoing back
on.  The handler should end by specifying the default action for the
signal that happened and then reraising it; this will cause the program
to terminate with that signal, as if it had not had a handler.
(See section <A HREF="library_21.html#SEC353" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_21.html#SEC353">Handlers That Terminate the Process</A>.)
<P>
Termination is the sensible ultimate outcome from a program error in
most programs.  However, programming systems such as Lisp that can load
compiled user programs might need to keep executing even if a user
program incurs an error.  These programs have handlers which use
<CODE>longjmp</CODE> to return control to the command level.
<P>
The default action for all of these signals is to cause the process to
terminate.  If you block or ignore these signals or establish handlers
for them that return normally, your program will probably break horribly
when such signals happen, unless they are generated by <CODE>raise</CODE> or
<CODE>kill</CODE> instead of a real error.
<A NAME="IDX1467"></A>
<P>
When one of these program error signals terminates a process, it also
writes a <DFN>core dump file</DFN> which records the state of the process at
the time of termination.  The core dump file is named <TT>`core'</TT> and is
written in whichever directory is current in the process at the time.
(On the GNU system, you can specify the file name for core dumps with
the environment variable <CODE>COREFILE</CODE>.)  The purpose of core dump
files is so that you can examine them with a debugger to investigate
what caused the error.
<P>
<A NAME="IDX1468"></A>
<U>Macro:</U> int <B>SIGFPE</B><P>
The <CODE>SIGFPE</CODE> signal reports a fatal arithmetic error.  Although the
name is derived from "floating-point exception", this signal actually
covers all arithmetic errors, including division by zero and overflow.
If a program stores integer data in a location which is then used in a
floating-point operation, this often causes an "invalid operation"
exception, because the processor cannot recognize the data as a
floating-point number.
<A NAME="IDX1470"></A>
<A NAME="IDX1469"></A>
<P>
Actual floating-point exceptions are a complicated subject because there
are many types of exceptions with subtly different meanings, and the
<CODE>SIGFPE</CODE> signal doesn't distinguish between them.  The <CITE>IEEE
Standard for Binary Floating-Point Arithmetic (ANSI/IEEE Std 754-1985)</CITE>
defines various floating-point exceptions and requires conforming
computer systems to report their occurrences.  However, this standard
does not specify how the exceptions are reported, or what kinds of
handling and control the operating system can offer to the programmer.
<P>
BSD systems provide the <CODE>SIGFPE</CODE> handler with an extra argument
that distinguishes various causes of the exception.  In order to access
this argument, you must define the handler to accept two arguments,
which means you must cast it to a one-argument function type in order to
establish the handler.  The GNU library does provide this extra

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线观看下载| 美腿丝袜一区二区三区| eeuss影院一区二区三区| 久久夜色精品国产噜噜av| 精品一区二区在线播放| 精品免费99久久| 国产黄色成人av| 日本一区二区成人在线| 99天天综合性| 亚洲高清免费在线| 欧美精品一卡二卡| 九色综合狠狠综合久久| 国产午夜亚洲精品羞羞网站| 99re热视频这里只精品| 亚洲国产aⅴ成人精品无吗| 日韩一区二区高清| 国产成人av电影免费在线观看| 国产精品久久久久精k8 | 久久成人免费网站| 久久综合色之久久综合| 99国产精品99久久久久久| 亚洲综合久久av| 4438x亚洲最大成人网| 蜜芽一区二区三区| 国产日韩欧美不卡| 欧美丝袜丝交足nylons| 国模一区二区三区白浆| 亚洲女爱视频在线| 欧美一区二区三区四区在线观看 | 精品成人私密视频| www.亚洲激情.com| 午夜久久电影网| 欧美国产日韩亚洲一区| 欧美日韩精品欧美日韩精品一 | 久久久久久久久岛国免费| 97久久精品人人澡人人爽| 日本va欧美va欧美va精品| 国产女主播一区| 欧美亚州韩日在线看免费版国语版 | 成人黄色电影在线 | 日本不卡的三区四区五区| 国产精品色婷婷久久58| 欧美精品99久久久**| 成人一区二区三区视频| 午夜精品成人在线视频| 欧美国产精品久久| 欧美电影免费观看高清完整版| 99精品久久99久久久久| 国产一区二区三区美女| 一区二区三区欧美在线观看| 久久美女艺术照精彩视频福利播放| 欧美中文字幕一区| 91香蕉视频污在线| 极品少妇一区二区| 亚洲午夜激情网站| 中文字幕一区日韩精品欧美| 日韩欧美国产一二三区| 欧美日韩精品三区| 欧美专区在线观看一区| 97se亚洲国产综合自在线观| 国产美女精品人人做人人爽| 蜜桃av一区二区三区电影| 亚洲免费观看高清完整| 精品免费国产二区三区 | 欧美一级高清大全免费观看| 在线精品视频一区二区| 99国产一区二区三精品乱码| 成人在线综合网站| 高清国产一区二区三区| 国产精品自拍毛片| 国产精品99久久久久久久vr | 成人福利在线看| 亚洲同性gay激情无套| 欧美一区二区三区思思人| 国产一区二三区好的| 亚洲成人自拍一区| 国产精品成人一区二区三区夜夜夜| 3751色影院一区二区三区| 91一区二区在线观看| 日一区二区三区| 亚洲女同女同女同女同女同69| 日韩免费一区二区三区在线播放| 欧美伊人久久大香线蕉综合69 | 欧美伊人久久久久久久久影院| 成人久久18免费网站麻豆 | 日韩av在线发布| 一区二区久久久久久| 国产精品进线69影院| 久久影视一区二区| 久久综合九色综合97婷婷女人 | 在线免费观看日韩欧美| aaa欧美日韩| 国产福利不卡视频| 激情都市一区二区| 精品亚洲欧美一区| 国产麻豆精品视频| 国产精品夜夜爽| 国产一区二区在线影院| 韩国毛片一区二区三区| 免费观看在线综合| 日本午夜一区二区| 日本在线播放一区二区三区| 日本午夜一本久久久综合| 亚洲男人的天堂av| 亚洲一区二区三区国产| 亚洲一区二区视频在线观看| 亚洲一区二区影院| 日韩av不卡在线观看| 麻豆精品久久精品色综合| 久久99久久精品| 国产美女娇喘av呻吟久久| 国产成人免费在线观看| 国产成人免费视频网站| 高清国产一区二区三区| 欧美人与禽zozo性伦| 欧美视频一区二区三区四区| 欧美精品在线一区二区三区| 欧美va天堂va视频va在线| 久久精品亚洲一区二区三区浴池| 欧美激情在线一区二区| 久久精品视频在线看| 中文字幕一区二区三区四区不卡| 亚洲欧美精品午睡沙发| 午夜不卡av在线| 狠狠色丁香九九婷婷综合五月| 国产精品夜夜爽| 欧美亚洲一区三区| 精品人在线二区三区| 一区二区久久久| 六月丁香综合在线视频| 成人高清伦理免费影院在线观看| 91福利小视频| 精品国产一区二区三区av性色| 中国色在线观看另类| 亚洲综合色自拍一区| 天天综合天天做天天综合| 9人人澡人人爽人人精品| 6080日韩午夜伦伦午夜伦| 久久久久久久久久看片| 亚洲国产日韩综合久久精品| 久久 天天综合| 欧美在线一二三四区| 欧美一卡2卡3卡4卡| 久久久精品日韩欧美| 亚洲小说欧美激情另类| 国产在线播放一区三区四| 在线视频一区二区三| 久久―日本道色综合久久| 一区二区在线观看av| 精品在线免费视频| 波多野结衣中文字幕一区| 亚洲精品一区二区在线观看| 亚洲精品国产视频| 国产大片一区二区| 91精品视频网| 亚洲视频免费观看| 国产乱码一区二区三区| 欧美精品1区2区| 亚洲男人的天堂网| 久久成人免费网| 91麻豆精品国产自产在线| 国产精品私人影院| 国模少妇一区二区三区| 欧美日韩成人综合| 国产精品网站导航| 国产很黄免费观看久久| 欧美大尺度电影在线| 亚洲综合丁香婷婷六月香| 不卡的电影网站| 久久青草国产手机看片福利盒子| 亚洲成人动漫av| 91美女片黄在线| 亚洲欧美色图小说| 99国产精品久久久久久久久久 | 亚洲电影欧美电影有声小说| 色综合中文综合网| 国产精品久久久久久亚洲毛片 | 88在线观看91蜜桃国自产| 亚洲女爱视频在线| 大尺度一区二区| 久久久99久久| 国产精品亚洲人在线观看| 久久综合色婷婷| 精品一区在线看| www国产亚洲精品久久麻豆| 亚洲一区二区黄色| 欧美夫妻性生活| 亚洲大片在线观看| 4438x亚洲最大成人网| 三级欧美在线一区| 欧美一二三在线| 亚洲在线中文字幕| 日韩一区二区中文字幕| 美女一区二区在线观看| 日韩三级电影网址| 激情文学综合丁香| 国产偷国产偷亚洲高清人白洁| 国产麻豆精品在线观看| 中文字幕亚洲成人| 色综合一个色综合|