Name

abort - causes abnormal program termination

Library

libc.lib

Synopsis

  #include <stdlib.h>
  void abort (void);

Return values

The abort function never returns.

Detailed description

The abort function causes abnormal program termination to occur, unless the signal SIGABRT is being caught and the signal handler does not return.

Any open streams are flushed and closed.


Examples

#include  <stdio.h>
#include  <stdlib.h>
 
int main( void )
{
   FILE *stream;
 
   if( (stream = fopen( "notexist.file", "r" )) == NULL )
   {
      perror( "Error occurred while opening file" );
      abort();
   }
   else
      fclose( stream );
   return 0;
}

         

Output

Error occurred while opening file: No such file or directory

         

Implementation notes

The abort function is thread-safe. It is unknown if it is async-cancel-safe.

Errors

No errors are defined.

Limitations

The signal related functionalities are not applicable to the symbian implementation as there is no support for signals from symbian.

See also

exit

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top