[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH 2/3] lib/uksysinfo: Register `uname` to syscall_shim
Registers `uname` system call to syscall_shim library. The implementation is changed to be a raw system call. Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx> --- lib/uksysinfo/Makefile.uk | 2 ++ lib/uksysinfo/exportsyms.uk | 2 ++ lib/uksysinfo/sysinfo.c | 9 ++++----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/uksysinfo/Makefile.uk b/lib/uksysinfo/Makefile.uk index 22ac28e7..1cb12681 100644 --- a/lib/uksysinfo/Makefile.uk +++ b/lib/uksysinfo/Makefile.uk @@ -4,3 +4,5 @@ CINCLUDES-$(CONFIG_LIBUKSYSINFO) += -I$(LIBUKSYSINFO_BASE)/include CXXINCLUDES-$(CONFIG_LIBUKSYSINFO) += -I$(LIBUKSYSINFO_BASE)/include LIBUKSYSINFO_SRCS-$(CONFIG_LIBUKSYSINFO) += $(LIBUKSYSINFO_BASE)/sysinfo.c + +UK_PROVIDED_SYSCALLS-$(CONFIG_LIBUKSYSINFO) += uname-1 diff --git a/lib/uksysinfo/exportsyms.uk b/lib/uksysinfo/exportsyms.uk index d5131332..addc4990 100644 --- a/lib/uksysinfo/exportsyms.uk +++ b/lib/uksysinfo/exportsyms.uk @@ -5,5 +5,7 @@ confstr pathconf getpagesize uname +uk_syscall_e_uname +uk_syscall_r_uname gethostname sethostname diff --git a/lib/uksysinfo/sysinfo.c b/lib/uksysinfo/sysinfo.c index fe746ad3..abcbb79d 100644 --- a/lib/uksysinfo/sysinfo.c +++ b/lib/uksysinfo/sysinfo.c @@ -41,6 +41,7 @@ #include <uk/essentials.h> #include <uk/config.h> #include <sys/sysinfo.h> +#include <uk/syscall.h> static struct utsname utsname = { .sysname = "Unikraft", @@ -94,12 +95,10 @@ int getpagesize(void) return __PAGE_SIZE; } -int uname(struct utsname *buf __unused) +UK_SYSCALL_R_DEFINE(int, uname, struct utsname *, buf) { - if (buf == NULL) { - errno = EFAULT; - return -1; - } + if (buf == NULL) + return -EFAULT; memcpy(buf, &utsname, sizeof(struct utsname)); return 0; -- 2.20.1 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |