EasySandbox.c
void exit(int exit_code)
{
	/* Invoke atexit handlers in reverse order. */
	while (s_atexit_handler_count > 0) {
		struct CxaAtexitHandler *handler;
		s_atexit_handler_count--;
		handler = &s_atexit_handlers[s_atexit_handler_count];
		switch (handler->type) {
		case 0:
			handler->f.atexit_fn();
			break;
		case 1:
			handler->f.cxa_atexit_fn(handler->arg);
			break;
		}
	}

	/* This is probably a good time to call destructor functions */
	wrapper_fini();
	wrapper_rtld_fini();

	/* Flush output streams */
	fflush(stdout);
	fflush(stderr);

	/* The loop is because gcc doesn't know that syscall doesn't return
	 * in this particular case */
	while (1) {
		syscall(SYS_exit, exit_code);
	}
}
/*
 * Re-implementation of exit.
 * Flushes stdout and stderr, and exits using the exit system
 * call.  glibc's exit function is unusable in SECCOMP mode because
 * it invokes the exit_group system call.
 */
Re-implementation of exit.
Flushes stdout and stderr, and exits using the exit system
call.  glibc's exit function is unusable in SECCOMP mode because
it invokes the exit_group system call.
Re - implementation of exit . Flushes stdout and stderr and exits using the exit system call . glibc ' s exit function is unusable in SECCOMP mode because it invokes the exit_group system call .
void exit(int exit_code)
{
	while (s_atexit_handler_count > 0) {
		struct CxaAtexitHandler *handler;
		s_atexit_handler_count--;
		handler = &s_atexit_handlers[s_atexit_handler_count];
		switch (handler->type) {
		case 0:
			handler->f.atexit_fn();
			break;
		case 1:
			handler->f.cxa_atexit_fn(handler->arg);
			break;
		}
	}
	wrapper_fini();
	wrapper_rtld_fini();
	fflush(stdout);
	fflush(stderr);
	while (1) {
		syscall(SYS_exit, exit_code);
	}
}
void exit ( int exit_code ) { while ( s_atexit_handler_count > 0 ) { struct CxaAtexitHandler * handler ; s_atexit_handler_count -- ; handler = & s_atexit_handlers [ s_atexit_handler_count ] ; switch ( handler -> type ) { case 0 : handler -> f . atexit_fn ( ) ; break ; case 1 : handler -> f . cxa_atexit_fn ( handler -> arg ) ; break ; } } wrapper_fini ( ) ; wrapper_rtld_fini ( ) ; fflush ( stdout ) ; fflush ( stderr ) ; while ( 1 ) { syscall ( SYS_exit , exit_code ) ; } }
Re-implementation of exit.
Re - implementation of exit .
/* Invoke atexit handlers in reverse order. */ /* This is probably a good time to call destructor functions */ /* Flush output streams */ /* The loop is because gcc doesn't know that syscall doesn't return
	 * in this particular case */