diff options
Diffstat (limited to 'libc/sys.c')
-rw-r--r-- | libc/sys.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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]); +} |