1. Technology
Send to a Friend via Email
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

You can opt-out at any time. Please refer to our privacy policy for contact information.

Discuss in my forum

©2014 About.com. All rights reserved.