Files
kolibrios/programs/develop/ktcc/trunk/libc.obj/source/stdlib/exit.c
Egor00f 61633d4dcc
Some checks failed
Build system / Build (pull_request) Failing after 2s
Build system / Check kernel codestyle (pull_request) Successful in 1m8s
libc.obj: update comments
2026-01-17 13:16:07 +05:00

31 lines
510 B
C

/* Copyright (C) 2021 Logaev Maxim (turbocat2001), GPLv2 */
#include <stdlib.h>
#include <sys/ksys.h>
#include "_mem.h"
static void __close_all()
{
}
static void __free_all_mem()
{
struct mem_node* current_node = __mem_node;
while (current_node != NULL) {
struct mem_node* tmp = current_node;
current_node = current_node->next;
free(GET_MEM_NODE_PTR(tmp));
}
}
void exit(int status)
{
__run_atexit();
__close_all();
__free_all_mem();
_exit(status);
}