-#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
- struct timeval it_value= { time_t(tv_sec), suseconds_t(tv_usec) };
+ errno= 0;
+ tv_sec= strtol(getenv("YATL_ALARM"), (char **) NULL, 10);
+
+ if (errno != 0)
+ {
+ FATAL("Bad value for YATL_ALARM");
+ }
+ else if (tv_sec == 0)
+ {
+ cancel_alarm();
+ }
+ }
+
+#ifdef __APPLE__
+ struct timeval it_value= { time_t(tv_sec), suseconds_t(tv_usec) };