Category : OS/2 Files
Archive   : EMXTST8F.ZIP
Filename : ALARM.C
#include
#include
#include
#include
static void usage (void)
{
fputs ("Usage: alarm [-sw]\n", stderr);
exit (1);
}
static void handler (int sig)
{
printf ("Signal %d received. Process stopped.\n", sig);
exit (1);
}
int main (int argc, char *argv[])
{
int c, wait_flag, sleep_flag;
wait_flag = 0; sleep_flag = 0;
if (argc == 2 && strcmp (argv[1], "-w") == 0)
wait_flag = 1;
else if (argc == 2 && strcmp (argv[1], "-s") == 0)
sleep_flag = 1;
else if (argc != 1)
usage ();
signal (SIGALRM, handler);
alarm (4);
if (sleep_flag)
printf ("sleep(10): %d\n", sleep (10));
else if (wait_flag)
for (;;)
;
else
for (;;)
{
c = _read_kbd (0, 0, 0);
if (c == 0)
_read_kbd (0, 1, 0);
else if (c == 0x1b)
break;
else if (c >= '0' && c <= '9')
printf ("alarm=%d\n", alarm (c - '0'));
}
return (0);
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/