본문 바로가기
C 언어

exit

by SpeeDr00t 2016. 7. 9.
반응형

void exit(int status)



#include <sys/types.h>
#include <sys/mman.h>
#include <stdlib.h>
#include <unistd.h>
#include "atexit.h"
#include "thread_private.h"

/*
 * This variable is zero until a process has created a thread.
 * It is used to avoid calling locking functions in libc when they
 * are not required. By default, libc is intended to be(come)
 * thread-safe, but without a (significant) penalty to non-threaded
 * processes.
 */
int     __isthreaded    = 0;

/*
 * Exit, flushing stdio buffers if necessary.
 */
void
exit(int status)
{
	/*
	 * Call functions registered by atexit() or _cxa_atexit()
	 * (including the stdio cleanup routine) and then _exit().
	 */
	__cxa_finalize(NULL);
	_exit(status);
}
반응형

'C 언어' 카테고리의 다른 글

calloc  (0) 2016.07.09
getenv  (0) 2016.07.09
heapsort  (0) 2016.07.09
malloc  (0) 2016.07.09
putenv  (0) 2016.07.09