Received: from eggs.gnu.org ([208.118.235.92]:56514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNIuJ-0003Nx-CE for qemu-devel@nongnu.org; Wed, 03 Apr 2013 04:19:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNIuI-0004LB-8Z for qemu-devel@nongnu.org; Wed, 03 Apr 2013 04:18:59 -0400 Received: from mail-qa0-f42.google.com ([209.85.216.42]:43343) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNIuI-0004L3-5V for qemu-devel@nongnu.org; Wed, 03 Apr 2013 04:18:58 -0400 Received: by mail-qa0-f42.google.com with SMTP id bv4so1907241qab.8 for ; Wed, 03 Apr 2013 01:18:57 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <515BE5EB.7040200@redhat.com> Date: Wed, 03 Apr 2013 10:18:51 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20130402154214.GJ26146@rox.home.comstyle.com> <515B0B1D.9050202@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Add configure clock_gettime() monotonic time test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, Brad Smith Il 03/04/2013 00:52, Peter Maydell ha scritto: > On 2 April 2013 17:45, Paolo Bonzini wrote: >> Il 02/04/2013 17:42, Brad Smith ha scritto: >>> Replace the hardcoded list of OS's utilizing clock_gettime() for monotonic >>> time with a configure test. This is to fix the use of monotonic time on >>> OpenBSD but allows for other POSIX compliant OS's such as NetBSD to also >>> utilize clock_gettime(). >> >> I thought the list of OSes was supposed to filter out those that somehow >> had a broken CLOCK_MONOTONIC. > > Judging from wading through git history, it's mostly just > historic accretion from an initial #ifdef __linux__ which was > put in by Fabrice way back when configure was barely doing > compile-this-code checks at all. > > Google does suggest that some OSes do provide a CLOCK_MONOTONIC > but clock_gettime(CLOCK_MONOTONIC) always fails, eg Centos 3. It would already fail, and no one reported it. CentOS 3 has a 2.4 kernel. I doubt anyone is using it with a recent QEMU. Paolo >> Otherwise, you might as well use "#ifdef CLOCK_MONOTONIC" and skip the >> configure test completely. > > Tempting. > > -- PMM > >