ack/lang/cem/libcc.ansi/sys/exit/exit.c
David Given af22b7ea85 Change stdio to use atexit() rather than the internal __clean variable; this
breaks the dependency between exit/atexit and stdio. Buffers are no longer
flushed on abort() (because it's pretty risky). Move the relevant functions
into sys/core.
2018-06-23 18:35:45 +02:00

23 lines
462 B
C

/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* $Id$ */
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include "atexits.h"
void (*__functab[NEXITS])(void);
int __funccnt = 0;
void exit(int status)
{
/* "Called in reversed order of their registration" */
while (__funccnt >= 0)
(*__functab[__funccnt])();
_exit(status);
}