1. Home
  2. Computing & Technology
  3. Linux
Linux / Unix Command: exit
Command Library

NAME

exit - cause normal program termination  

SYNOPSIS

#include <stdlib.h>

void exit(int status);
 

DESCRIPTION

The exit() function causes normal program termination and the the value of status & 0377 is returned to the parent (see wait(2)). All functions registered with atexit() and on_exit() are called in the reverse order of their registration, and all open streams are flushed and closed. Files created by tmpfile() are removed.

The C standard specifies two defines EXIT_SUCCESS and EXIT_FAILURE that may be passed to exit() to indicate successful or unsuccessful termination, respectively.  

RETURN VALUE

The exit() function does not return.  

CONFORMING TO

SVID 3, POSIX, BSD 4.3, ISO 9899 (``ANSI C'')  

SEE ALSO

_exit(2), wait(2), atexit(3), on_exit(3), tmpfile(3)


Important: Use the man command (% man) to see how a command is used on your particular computer.

>> Linux/Unix Command Library

>> Shell Command Library

Explore Linux
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Linux

©2009 About.com, a part of The New York Times Company.

All rights reserved.