libk  stop.fn.c at [5393623a84]

File kcore/stop.fn.c artifact 5c15d4cc49 part of check-in 5393623a84


/* kcore/stop.fn.c - kstop()
 * ~ lexi hale <lexi@hale.su>
 * this file defines a function that prematurely exits from
 * a running libk program with an appropriate exit status. */

#include <k/core.h>
#include <k/def.h> // so we know what system this is
#include <k/type.h>

#ifdef KFenv_posix
#	define STOPFN kio_posix_exit
	extern noreturn void STOPFN(int);
#else
	Knoimpl(kstop)
#endif

noreturn void kstop (stat_long code) { STOPFN(code); }