OSDN Git Service

0ecdf300f3736257f78daeb51e43c5f045f684fa
[linuxjm/LDP_man-pages.git] / original / man3 / abort.3
1 .\" Copyright 2007 (C) Michael Kerrisk <mtk.manpages@gmail.com>
2 .\" some parts Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .\" References consulted:
27 .\"     Linux libc source code
28 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
29 .\"     386BSD man pages
30 .\" Modified Sat Jul 24 21:46:21 1993 by Rik Faith (faith@cs.unc.edu)
31 .\" Modified Fri Aug  4 10:51:53 2000 - patch from Joseph S. Myers
32 .\" 2007-12-15, mtk, Mostly rewritten
33 .\"
34 .TH ABORT 3  2014-12-31 "GNU" "Linux Programmer's Manual"
35 .SH NAME
36 abort \- cause abnormal process termination
37 .SH SYNOPSIS
38 .nf
39 .B #include <stdlib.h>
40 .sp
41 .B void abort(void);
42 .fi
43 .SH DESCRIPTION
44 The
45 .BR abort ()
46 first unblocks the
47 .B SIGABRT
48 signal, and then raises that signal for the calling process
49 (as though
50 .BR raise (3)
51 was called).
52 This results in the abnormal termination of the process unless the
53 .B SIGABRT
54 signal is caught and the signal handler does not return
55 (see
56 .BR longjmp (3)).
57 .PP
58 If the
59 .BR abort ()
60 function causes process termination,
61 all open streams are closed and flushed.
62 .PP
63 If the
64 .B SIGABRT
65 signal is ignored, or caught by a handler that returns, the
66 .BR abort ()
67 function will still terminate the process.
68 It does this by restoring the default disposition for
69 .B SIGABRT
70 and then raising the signal for a second time.
71 .SH RETURN VALUE
72 The
73 .BR abort ()
74 function never returns.
75 .SH ATTRIBUTES
76 .SS Multithreading (see pthreads(7))
77 The
78 .BR abort ()
79 function is thread-safe.
80 .SH CONFORMING TO
81 SVr4, POSIX.1-2001, POSIX.1-2008, 4.3BSD, C89, C99.
82 .SH SEE ALSO
83 .BR gdb (1),
84 .BR sigaction (2),
85 .BR exit (3),
86 .BR longjmp (3),
87 .BR raise (3)
88 .SH COLOPHON
89 This page is part of release 3.79 of the Linux
90 .I man-pages
91 project.
92 A description of the project,
93 information about reporting bugs,
94 and the latest version of this page,
95 can be found at
96 \%http://www.kernel.org/doc/man\-pages/.