plan9fox/sys/src/libc/port/exits.c
cinap_lenrek e3d8fe9d4a libc: cleanup atexit and put exits() in its own compilation unit
this avoids having to pull in atexit() and its dependencies
(lock(), unlock()) into every program. (as exits() is called
by _main() from main9.s).
2017-10-20 20:58:38 +02:00

14 lines
149 B
C

#include <u.h>
#include <libc.h>
void (*_onexit)(void);
#pragma profile off
void
exits(char *s)
{
if(_onexit != nil) (*_onexit)();
_exits(s);
}