_ Exit () function instructions

Source: Internet
Author: User

_ Exit () function instructions
Abstract:This article describes the use of the _ exit () function in the Linux manual page, the use of the _ exit () function to terminate the process.
NAME
_ Exit (), _ Exit ()-terminate the process.
SYNOPSIS
# Include <unistd. h>
Void _ exit (int status );
# Include <stdlib. h>
Void _ Exit (int status );
Feature Test Macro Requirements for glibc (see feature_test_macros (7 )):
_ Exit ():
_ XOPEN_SOURCE> = 600 | _ ISOC99_SOURCE | _ POSIX_C_SOURCE> = 2001_l;
Or cc-std = c99
DESCRIPTION
Call the _ exit () function to terminate the process immediately. All opened file descriptors of the process are closed. The child process of the process will belong to the init process and become the child process of init, and sends the SIGCHLD signal to the parent process.
The termination status is passed to the parent process. Based on the termination status of the child process, the parent process can call the wait () function to process the child process.
Function _ Exit () is equivalent to function _ exit ().
RETURN VALUE
The _ exit () and _ Exit () functions do not return values.
CONFORMING
SVr4, POSIX.1-2001, 4.3BSD. The function _ Exit () was introduced by C99.
NOTES
This article discusses the role of terminating a process, transmission of the termination status, zombie process, and signal sending. For details, see the exit () function.
Function _ exit () is similar to exit (), but the _ exit () function does not call the terminate handler registered by the atexit () and on_exit () functions. whether it clears the IO buffer and deletes temporary files depends on the actual situation. when the _ exit () function is called, disabling the file descriptor may cause an unknown delay and wait for the output to complete. if you do not want latency, you can call the tcflush () function before calling the _ exit () function. The process determines whether to cancel the wait IO.
Before glibc 2.3, the library function _ exit () has the same name as the kernel system call. After glibc 2.3, the library function calls exit_group () to terminate all threads in the process.
END

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.