snapshot 20120724 sleep failure

marco atzeri marco.atzeri@gmail.com
Wed Jul 25 19:52:00 GMT 2012


on  1.7.17s(0.262/5/3) 20120724

autoconf test for sleep never completes

checking whether sleep is declared... yes
checking for working sleep...

on 1.7.16 the test take 1 second

-----------------------------
#include <errno.h>
#include <unistd.h>
#include <signal.h>
static void
handle_alarm (int sig)
{
   if (sig != SIGALRM)
     _exit (2);
}

int
main ()
{

     /* Failure to compile this test due to missing alarm is okay,
        since all such platforms (mingw) also lack sleep.  */
     unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days.  */
     unsigned int remaining;
     signal (SIGALRM, handle_alarm);
     alarm (1);
     remaining = sleep (pentecost);
     if (remaining > pentecost)
       return 3;
     if (remaining <= pentecost - 10)
       return 4;
     return 0;

   ;
   return 0;
}
----------------------------------

Regards
Marco

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list