1*f215054dSNamhyung Kim /* SPDX-License-Identifier: GPL-2.0 */ 2*f215054dSNamhyung Kim #include <stdlib.h> 3*f215054dSNamhyung Kim #include <signal.h> 4*f215054dSNamhyung Kim #include <unistd.h> 5*f215054dSNamhyung Kim #include <linux/compiler.h> 6*f215054dSNamhyung Kim #include "../tests.h" 7*f215054dSNamhyung Kim 8*f215054dSNamhyung Kim static volatile sig_atomic_t done; 9*f215054dSNamhyung Kim 10*f215054dSNamhyung Kim static void sighandler(int sig __maybe_unused) 11*f215054dSNamhyung Kim { 12*f215054dSNamhyung Kim done = 1; 13*f215054dSNamhyung Kim } 14*f215054dSNamhyung Kim 15*f215054dSNamhyung Kim static int noploop(int argc, const char **argv) 16*f215054dSNamhyung Kim { 17*f215054dSNamhyung Kim int sec = 1; 18*f215054dSNamhyung Kim 19*f215054dSNamhyung Kim if (argc > 0) 20*f215054dSNamhyung Kim sec = atoi(argv[0]); 21*f215054dSNamhyung Kim 22*f215054dSNamhyung Kim signal(SIGINT, sighandler); 23*f215054dSNamhyung Kim signal(SIGALRM, sighandler); 24*f215054dSNamhyung Kim alarm(sec); 25*f215054dSNamhyung Kim 26*f215054dSNamhyung Kim while (!done) 27*f215054dSNamhyung Kim continue; 28*f215054dSNamhyung Kim 29*f215054dSNamhyung Kim return 0; 30*f215054dSNamhyung Kim } 31*f215054dSNamhyung Kim 32*f215054dSNamhyung Kim DEFINE_WORKLOAD(noploop); 33