From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Mon, 27 Dec 2021 20:57:05 -0800 Subject: [PATCH] serenity: Disable itimer testing when compiling for Serenity The itimer APIs are not implemented in serenity, so just disable these tests. --- stress-itimer.c | 10 ++++++++++ stress-sysbadaddr.c | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/stress-itimer.c b/stress-itimer.c index b2e466a..e8ead6a 100644 --- a/stress-itimer.c +++ b/stress-itimer.c @@ -35,6 +35,8 @@ static const stress_help_t help[] = { { NULL, NULL, NULL } }; +#if !defined(__serenity__) + static const int stress_itimers[] = { #if defined(ITIMER_REAL) ITIMER_REAL, @@ -223,3 +225,11 @@ stressor_info_t stress_itimer_info = { .verify = VERIFY_ALWAYS, .help = help }; +#else +stressor_info_t stress_itimer_info = { + .stressor = stress_not_implemented, + .class = CLASS_INTERRUPT | CLASS_OS, + .help = help +}; +#endif + diff --git a/stress-sysbadaddr.c b/stress-sysbadaddr.c index 5d9a10a..cacd01c 100644 --- a/stress-sysbadaddr.c +++ b/stress-sysbadaddr.c @@ -385,10 +385,12 @@ static int bad_gethostname(void *addr) } #endif +#if !defined(__serenity__) static int bad_getitimer(void *addr) { return getitimer(ITIMER_PROF, (struct itimerval *)addr); } +#endif static int bad_getpeername(void *addr) { @@ -694,11 +696,13 @@ static int bad_select(void *addr) return ret; } +#if !defined(__serenity__) static int bad_setitimer(void *addr) { return setitimer(ITIMER_PROF, (struct itimerval *)addr, (struct itimerval *)inc_addr(addr, 1)); } +#endif static int bad_setrlimit(void *addr) { @@ -892,7 +896,9 @@ static stress_bad_syscall_t bad_syscalls[] = { #if defined(HAVE_GETHOSTNAME) bad_gethostname, #endif +#if !defined(__serenity__) bad_getitimer, +#endif bad_getpeername, bad_getrandom, bad_getrlimit, @@ -966,7 +972,9 @@ static stress_bad_syscall_t bad_syscalls[] = { bad_sched_getaffinity, #endif bad_select, +#if !defined(__serenity__) bad_setitimer, +#endif bad_setrlimit, bad_stat, #if defined(HAVE_STATFS) @@ -1022,7 +1030,9 @@ static inline int stress_do_syscall( if (pid < 0) { _exit(EXIT_NO_RESOURCE); } else if (pid == 0) { +#if !defined(__serenity__) struct itimerval it; +#endif size_t i; int ret; @@ -1045,6 +1055,7 @@ static inline int stress_do_syscall( stress_parent_died_alarm(); (void)sched_settings_apply(true); +#if !defined(__serenity__) /* * Force abort if we take too long */ @@ -1057,6 +1068,7 @@ static inline int stress_do_syscall( args->name, errno, strerror(errno)); _exit(EXIT_NO_RESOURCE); } +#endif ret = bad_syscall(addr); if (ret < 0)