From: Waldemar Kozaczuk <[email protected]>
Committer: Nadav Har'El <[email protected]>
Branch: master
Add sys_exit_group syscall used by golang
Normally applications do not directly call exit_group() but instead use
a wrapper function _exit(). However Golang system library bypasses libc and
calls sys_exit_group when handling sys.Exit() function.
Techically sys_exit() and sys_exit_group() behave slighly differently
on Linux however given OSv is a unikernel and exit() in OSv terminates
both app and kernel, it makes sense for sys_exit_group() do the same thing.
Signed-off-by: Waldemar Kozaczuk <[email protected]>
Message-Id: <[email protected]>
---
diff --git a/linux.cc b/linux.cc
--- a/linux.cc
+++ b/linux.cc
@@ -318,6 +318,13 @@ static int sys_exit(int ret)
return 0;
}
+#define __NR_sys_exit_group __NR_exit_group
+static int sys_exit_group(int ret)
+{
+ exit(ret);
+ return 0;
+}
+
#define __NR_sys_ioctl __NR_ioctl
//
// We need to define explicit sys_ioctl that takes these 3 parameters to
conform
@@ -421,6 +428,7 @@ long syscall(long number, ...)
SYSCALL3(getrandom, char *, size_t, unsigned int);
SYSCALL2(nanosleep, const struct timespec*, struct timespec *);
SYSCALL4(fstatat, int, const char *, struct stat *, int);
+ SYSCALL1(sys_exit_group, int);
}
debug_always("syscall(): unimplemented system call %d\n", number);
--
You received this message because you are subscribed to the Google Groups "OSv
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.