I put a process to sleep. When a process is put to sleep, it is marked as being in a special state and removed from the scheduler's run queue, and I want to wake it up by sending a signal via the command line, how can I do that. Let's say I have this C code which uses sleep
for 100 seconds.
What signal do I need to send in order to wake it up and make the return value to be the seconds that remain from the sleep?
#include <unistd.h>
#include <stdio.h>
int main(void)
{
printf("Current Proc ID is: %d. Wake me Up!\n", getpid());
int time_remain = sleep(100);
printf("Time Remain of sleep: %d\n", time_remain);
return 0;
}