/*
 * @author  xamidev <xamidev@riseup.net>
 * @brief   Process-wide system calls
 * @license GPL-3.0-only
 */

#include <kernel.h>
#include <sched/process.h>

extern struct process* current_process;

/*
 * sys_exit - Terminate the current process
 * @error_code: error code to return
 *
 * This system call exits the running process. Be aware that
 * it does nothing except that. All resources are supposed to
 * be cleaned up before calling this.
 *
 * Return:
 * %error_code - the error code to return
 */
int sys_exit(int error_code)
{
    current_process->status = DEAD;
    DEBUG("(pid=%u, name=%s)", current_process->pid, current_process->name);
    return error_code;
}