aboutsummaryrefslogtreecommitdiff
path: root/libc/sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sys.c')
-rw-r--r--libc/sys.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libc/sys.c b/libc/sys.c
index d676445..a2c789e 100644
--- a/libc/sys.c
+++ b/libc/sys.c
@@ -1,6 +1,7 @@
// MIT License, Copyright (c) 2020 Marvin Borner
// Syscall implementation
+#include <arg.h>
#include <sys.h>
/**
@@ -55,3 +56,17 @@ int sys5(enum sys num, int d1, int d2, int d3, int d4, int d5)
"D"((int)d5));
return a;
}
+
+#include <print.h>
+int sysv(enum sys num, ...)
+{
+ va_list ap;
+ int args[5];
+
+ va_start(ap, num);
+ for (int i = 0; i < 5; i++)
+ args[i] = va_arg(ap, int);
+ va_end(ap);
+
+ return sys5(num, args[0], args[1], args[2], args[3], args[4]);
+}