Name

_Exit

Synopsis

Ends program execution without calling atexit() functions or signal handlers

#include <stdlib.h>
void_Exit( int status );

The _Exit() function terminates the program normally, but without calling any cleanup functions that you have installed using atexit(), or signal handlers you have installed using signal(). Exit() returns a status value to the operating system in the same way as the exit() function does.

Whether _Exit() flushes the program’s file buffers or removes its temporary files may vary from one implementation to another.

Example

int main (int argc, char *argv[ ])
{
  if (argc < 3)
  {
    fprintf(stderr, "Missing required arguments.\n");_Exit(-1);
  }
  /* ... */
}

Get C in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.