From 4afe4fae1bc68b7610cbd922cc52a7bb455f988a Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Fri, 19 Jun 2020 19:33:06 +0000 Subject: [PATCH] Add warnings for unsupported Linux clockids. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25322 --- sys/compat/linux/linux_time.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/compat/linux/linux_time.c b/sys/compat/linux/linux_time.c index 452188f057a3..be38ef037a0f 100644 --- a/sys/compat/linux/linux_time.c +++ b/sys/compat/linux/linux_time.c @@ -67,6 +67,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.14 2006/05/14 03:40:54 christos Exp #include #include #include +#include /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); @@ -268,6 +269,8 @@ linux_clock_gettime(struct thread *td, struct linux_clock_gettime_args *args) error = linux_to_native_clockid(&nwhich, args->which); if (error != 0) { + linux_msg(curthread, + "unsupported clock_gettime clockid %d", args->which); LIN_SDT_PROBE1(time, linux_clock_gettime, conversion_error, error); LIN_SDT_PROBE1(time, linux_clock_gettime, return, error); @@ -399,6 +402,8 @@ linux_clock_settime(struct thread *td, struct linux_clock_settime_args *args) error = linux_to_native_clockid(&nwhich, args->which); if (error != 0) { + linux_msg(curthread, + "unsupported clock_settime clockid %d", args->which); LIN_SDT_PROBE1(time, linux_clock_settime, conversion_error, error); LIN_SDT_PROBE1(time, linux_clock_settime, return, error); @@ -441,6 +446,8 @@ linux_clock_getres(struct thread *td, struct linux_clock_getres_args *args) error = linux_to_native_clockid(&nwhich, args->which); if (error != 0) { + linux_msg(curthread, + "unsupported clock_getres clockid %d", args->which); LIN_SDT_PROBE1(time, linux_clock_getres, conversion_error, error); LIN_SDT_PROBE1(time, linux_clock_getres, return, error); @@ -600,6 +607,8 @@ linux_clock_nanosleep(struct thread *td, struct linux_clock_nanosleep_args *args error = linux_to_native_clockid(&clockid, args->which); if (error != 0) { + linux_msg(curthread, + "unsupported clock_nanosleep clockid %d", args->which); LIN_SDT_PROBE1(time, linux_clock_nanosleep, unsupported_clockid, args->which); LIN_SDT_PROBE1(time, linux_clock_settime, return, error);