Reclaim process user space resource exit () function _ exit () function atexit () function on_exit () function, _ exitatexitAbstract:This article describes how to terminate a process and how to use the exit () function to terminate the process and
The exit and exit status codes exit are used to end a script, just like in C. it also returns a value, which is passed to the parent process of the script. The parent process uses this value for further processing. each command returns an exit
Exit and exit Status Codes
Exit is used to end a script, just like in C. it also returns a value, which is passed to the parent process of the script. The parent process uses this value for further processing.
Each command returns an exit status
Exit () and _ exit () and return, exit_exitreturnThe difference between exit () and return: According to ansi c, return and exit () are used in the originally called main () with the same effect. However, note that "initial call" is used here ". If
Now I've written a Hello World program to take a look at it:
Filename:main.c
#include
int main (void)
{
printf ("Hello wolrd!\n");
return (-);
}
Compile execution: gcc main.c &&/a.out
Now let's take a look at the return
Address: http://blog.sina.com.cn/s/blog_4850a7880100hncm.html
Reference: http://lzjyjh.blog.sohu.com/137646727.html
-----------------------------------------------
In Unix OS, the system calls exit to terminate a process. Calls that can be
1. Exit FunctionThe C,c++ function exit is used to terminate the current program, and the function is defined as follows:
void exit (int status);
The official notes are as follows:Terminates the process normally, performing the regular
Exit seems to be in the "stdlib. H" header file, so it must contain the header fileReturn indicates a function call. If the main function is returned, the system exits the program.Exit is to forcibly exit the program at the call. Once the program is
Write a Hello World: Filename:main.c#include int Main (void) {printf ("Hello wolrd!\n"); Return (-1); } Compile execution: gcc main.c &&./a.out Now let's see what is the return value of the previous execution in the current shell, which is "1"?
In a password-protected Web application, it is not just a matter of calling the HttpSession invalidate () method to properly handle the user exit process. Now most browsers have back and forward buttons that allow the user to step back or forward to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.