delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/07/25/15:53:10

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
Message-ID: <50104E84.2070108@gmail.com>
Date: Wed, 25 Jul 2012 21:52:36 +0200
From: marco atzeri <marco DOT atzeri AT gmail DOT com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: snapshot 20120724 sleep failure
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019