#include void sig_handler(){ static int i = 1; printf("beep\n"); alarm(i); ++i; } int main(){ struct sigaction sa; sa.sa_flags = 0; sa.sa_handler = sig_handler; if(sigaction(sigalrm, & sa, null) ! = 0){ printf("failed to bind handler.\n"); exit(1); } printf("going into an infinite loop.\n"); alarm(1); while(1); return 0; }
suppose the above program is run for 7.5 seconds after it prints "going into an infinite loop". the program is run multiple times where the "system load" from other processes sharing the cpu will vary from none to many other processes. which best characterizes how many times "beep" is printed?

Solved
Show answers

Ask an AI advisor a question