Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between _Exit() and _exit()?

Tags:

c++

In answer to this question, some people have said to use _Exit() and others have said to use _exit(). Could someone explain the difference (if any) between the two, and the origins of both?

like image 877
Samuel Harmer Avatar asked Dec 21 '22 03:12

Samuel Harmer


2 Answers

Right from the man page here:

The function _Exit() is equivalent to _exit().

Although in C++11, it is standardized as either std::_Exit or std::quick_exit. According to Mike Seymour here.

like image 87
Grammin Avatar answered Dec 23 '22 16:12

Grammin


_Exit(2) is from C99. _exit(2) is from POSIX. At least, according to the manpage I have installed here.

They are entirely equivalent.

like image 36
cha0site Avatar answered Dec 23 '22 15:12

cha0site