shithub: scc

ref: 5c0bbb5ff6603cf20c4e3f4ec16dd7b60799cb85
dir: /src/libc/stdlib/exit.c/

View raw version
#include <stdlib.h>

#include "../libc.h"
#include "../syscall.h"

#undef exit

void (*_flushall)(void);
void (*_atexithdl)(void);

void
exit(int status)
{
	if (_atexithdl)
		(*_atexithdl)();
	if (_flushall)
		(*_flushall)();
	_exit(status);
}