From: Razvan Deaconescu Date: Sun, 14 Feb 2021 20:09:16 +0000 (+0200) Subject: lib/uktime: Register times syscall in syscall shim X-Git-Tag: RELEASE-0.6~226 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=036ec4c36c7012af611ed206ae8d4c13d0a230d0;p=unikraft%2Funikraft.git lib/uktime: Register times syscall in syscall shim The times syscall is marked as not supported, i.e. returns -ENOTSUP. Signed-off-by: Razvan Deaconescu Reviewed-by: Sergiu Moga Tested-by: Unikraft CI GitHub-Pull-Request: #125 --- diff --git a/lib/uktime/Makefile.uk b/lib/uktime/Makefile.uk index d4d4f8650..630e4e886 100644 --- a/lib/uktime/Makefile.uk +++ b/lib/uktime/Makefile.uk @@ -16,3 +16,4 @@ LIBUKTIME_SRCS-y += $(LIBUKTIME_BASE)/timer.c UK_PROVIDED_SYSCALLS-$(CONFIG_LIBUKTIME) += nanosleep-2 UK_PROVIDED_SYSCALLS-$(CONFIG_LIBUKTIME) += clock_gettime-2 UK_PROVIDED_SYSCALLS-$(CONFIG_LIBUKTIME) += gettimeofday-2 +UK_PROVIDED_SYSCALLS-$(CONFIG_LIBUKTIME) += times-1 diff --git a/lib/uktime/exportsyms.uk b/lib/uktime/exportsyms.uk index ed5ab8238..0e9fa7362 100644 --- a/lib/uktime/exportsyms.uk +++ b/lib/uktime/exportsyms.uk @@ -13,6 +13,8 @@ setitimer sleep timegm times +uk_syscall_e_times +uk_syscall_r_times usleep utime timer_create diff --git a/lib/uktime/time.c b/lib/uktime/time.c index c757da951..8fa30ab60 100644 --- a/lib/uktime/time.c +++ b/lib/uktime/time.c @@ -176,10 +176,9 @@ int clock_settime(clockid_t clk_id __unused, const struct timespec *tp __unused) return 0; } -int times(struct tm *buf __unused) +UK_SYSCALL_R_DEFINE(int, times, struct tm *, buf) { - errno = ENOTSUP; - return -1; + return -ENOTSUP; } int setitimer(int which __unused, const struct itimerval *new_value __unused,