This is the mail archive of the
cygwin
mailing list for the Cygwin project.
snapshot 20120724 sleep failure
- From: marco atzeri <marco dot atzeri at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 25 Jul 2012 21:52:36 +0200
- Subject: snapshot 20120724 sleep failure
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