sd: remove 'ssd' driver support
[unleashed/tickless.git] / usr / src / lib / libast / common / vmalloc / vmexit.c
blobea811775469c604a51950602e4614c829a68561c
1 /***********************************************************************
2 * *
3 * This software is part of the ast package *
4 * Copyright (c) 1985-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
8 * *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
12 * *
13 * Information and Software Systems Research *
14 * AT&T Research *
15 * Florham Park NJ *
16 * *
17 * Glenn Fowler <gsf@research.att.com> *
18 * David Korn <dgk@research.att.com> *
19 * Phong Vo <kpv@research.att.com> *
20 * *
21 ***********************************************************************/
22 #if defined(_UWIN)
24 void _STUB_vmexit(){}
26 #else
28 #include "vmhdr.h"
31 ** Any required functions for process exiting.
32 ** Written by Kiem-Phong Vo, kpv@research.att.com (05/25/93).
34 #if _PACKAGE_ast || _lib_atexit
36 void _STUB_vmexit(){}
38 #else
40 #if _lib_onexit
42 #if __STD_C
43 int atexit(void (*exitf)(void))
44 #else
45 int atexit(exitf)
46 void (*exitf)();
47 #endif
49 return onexit(exitf);
52 #else /*!_lib_onexit*/
54 typedef struct _exit_s
55 { struct _exit_s* next;
56 void(* exitf)_ARG_((void));
57 } Exit_t;
58 static Exit_t* Exit;
60 #if __STD_C
61 atexit(void (*exitf)(void))
62 #else
63 atexit(exitf)
64 void (*exitf)();
65 #endif
66 { Exit_t* e;
68 if(!(e = (Exit_t*)malloc(sizeof(Exit_t))) )
69 return -1;
70 e->exitf = exitf;
71 e->next = Exit;
72 Exit = e;
73 return 0;
76 #if __STD_C
77 void exit(int type)
78 #else
79 void exit(type)
80 int type;
81 #endif
83 Exit_t* e;
85 for(e = Exit; e; e = e->next)
86 (*e->exitf)();
88 #if _exit_cleanup
89 _cleanup();
90 #endif
92 _exit(type);
93 return type;
96 #endif /* _lib_onexit || _lib_on_exit */
98 #endif /*!PACKAGE_ast*/
100 #endif