Skip to content

Commit 0bff72d

Browse files
committed
exit syscall
1 parent a099f94 commit 0bff72d

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

kernel/interfaces/system/syscall/proc.cppm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,5 @@ export namespace syscall::proc
125125
int sched_getaffinity(pid_t pid, std::size_t cpusetsize, std::uint8_t __user *mask);
126126

127127
[[noreturn]] void exit_group(int status);
128+
[[noreturn]] void exit(int status);
128129
} // export namespace syscall::proc

kernel/source/arch/x86_64/system/syscall.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ namespace x86_64::syscall
7979
[57] = { "fork", proc::fork, true },
8080
[58] = { "vfork", proc::vfork, true },
8181
[59] = { "execve", proc::execve },
82+
[60] = { "exit", proc::exit },
8283
[61] = { "wait4", proc::wait4, true },
8384
[62] = { "kill", proc::kill },
8485
[63] = { "uname", misc::uname },

kernel/source/system/syscall/proc.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,4 +1155,10 @@ namespace syscall::proc
11551155
sched::process_exit(status);
11561156
std::unreachable();
11571157
}
1158+
1159+
[[noreturn]] void exit(int status)
1160+
{
1161+
sched::thread_exit(status);
1162+
std::unreachable();
1163+
}
11581164
} // namespace syscall::proc

0 commit comments

Comments
 (0)