.TH abort() "" "" "General Function (libc)"
.PC "End program immediately"
.B "#include <stdlib.h>"
\fBvoid abort(\^)\fR
.PP
.B abort()
terminates a process
with a core dump, creating a file called \fBcore\fR,
and prints a message on the screen.
It is normally invoked in situations
that \*(QLshould not happen\*(QR.
For example,
.B malloc()
invokes
.B abort()
if it discovers a corrupt storage arena.
.PP
Where possible,
.B abort()
executes a machine instruction that causes the processor to trap.
If the signal associated with the trap is caught or ignored,
the dump will not be produced.
.\" .SH Example
.\" .DM
.\" main() {
.\" 	int i = 1;
.\" 	int j = 2;
.\" 
.\" 	if (i > j)
.\" 		abort();
.\" 	else
.\" 		printf("This computer works correctly.\n");
.\" }
.\" .DE
.SH "See Also"
.Xr _exit(), _5Fexit
.Xr core, core
.Xr exit(), exit
.Xr libc, libc
.Xr stdlib.h stdlib.h
.br
\*(AS, \(sc7.10.4.1
.br
\*(PX Standard, \(sc8.1
