As previously mentioned, the older interfaces include the following:
- The alarm(2) system call
- The interval timer [get|set]itimer(2) system call APIs
Let's begin with the first of them.
As previously mentioned, the older interfaces include the following:
Let's begin with the first of them.
The alarm(2) system call allows a process to set up a simple timeout mechanism; its signature is as follows:
#include <unistd.h>
unsigned int alarm(unsigned int seconds);
It is, indeed, quite self-explanatory. Let's take a simple example: A process wants to set up a timer that will expire in three seconds from now, so alarm(3) is essentially the code to use to do this.
What exactly happens in the aforementioned code? Three seconds after the alarm system call is issued—that...