forked from Stichting-MINIX-Research-Foundation/minix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexit.c
More file actions
36 lines (28 loc) · 626 Bytes
/
Copy pathexit.c
File metadata and controls
36 lines (28 loc) · 626 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
/* $Header$ */
#include <stdio.h>
#include <stdlib.h>
#define NEXITS 32
void (*__functab[NEXITS])(void);
int __funccnt = 0;
extern void _exit(int);
/* only flush output buffers when necessary */
int (*_clean)(void) = NULL;
static void
_calls(void)
{
register int i = __funccnt;
/* "Called in reversed order of their registration" */
while (--i >= 0)
(*__functab[i])();
}
void
exit(int status)
{
_calls();
if (_clean) _clean();
_exit(status) ;
}