From 85575704a4c1939f25414bc585a72bd940e85ceb Mon Sep 17 00:00:00 2001 From: Shritesh Bhattarai Date: Tue, 26 Mar 2019 16:44:48 -0500 Subject: Use linux.exit_group if not single threaded --- std/os.zig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'std/os.zig') diff --git a/std/os.zig b/std/os.zig index 7773976de5..c5025bbeb4 100644 --- a/std/os.zig +++ b/std/os.zig @@ -213,7 +213,14 @@ pub fn exit(status: u8) noreturn { c.exit(status); } switch (builtin.os) { - Os.linux, Os.macosx, Os.ios, Os.freebsd, Os.netbsd => { + Os.linux => { + if (builtin.single_threaded) { + linux.exit(status); + } else { + linux.exit_group(status); + } + }, + Os.macosx, Os.ios, Os.freebsd, Os.netbsd => { posix.exit(status); }, Os.windows => { -- cgit v1.2.3