From owner-freebsd-threads@FreeBSD.ORG Mon May 24 14:59:50 2010 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B570E1065670 for ; Mon, 24 May 2010 14:59:50 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 2DADD8FC1D for ; Mon, 24 May 2010 14:59:49 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.4/8.14.4/NETPLEX) with ESMTP id o4OExiFf020122; Mon, 24 May 2010 10:59:44 -0400 (EDT) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.2.2 (mail.netplex.net [204.213.176.10]); Mon, 24 May 2010 10:59:44 -0400 (EDT) Date: Mon, 24 May 2010 10:59:44 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Chris Vine In-Reply-To: <20100524151426.7ec75b1a@boulder.homenet> Message-ID: References: <20100524140513.6475cb2c@boulder.homenet> <20100524151426.7ec75b1a@boulder.homenet> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-threads@freebsd.org Subject: Re: Monotonic clocks X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2010 14:59:50 -0000 On Mon, 24 May 2010, Chris Vine wrote: > On Mon, 24 May 2010 09:46:39 -0400 (EDT) > Daniel Eischen wrote: >> On Mon, 24 May 2010, Chris Vine wrote: >> >>> Hi, >>> >>> I am the upstream maintainer of efax-gtk and I am told recent >>> versions of the program will not compile on the FreeBSD port of >>> debian, because FreeBSD does not appear to provide >>> pthread_condattr_setclock() to set a monotonic clock on condition >>> variables. >>> >>> The program configuration script calls up sysconf() to determine >>> whether the POSIX advanced realtime option (_SC_MONOTONIC_CLOCK) is >>> provided, and FreeBSD's sysconf() indicates that it is. Is anything >>> else needed to enable monotonic clocks on BSD, or is sysconf() >>> incorrectly advertising the implementation of monotonic clocks in >>> BSD's libc? >> >> What version of FreeBSD are you using? The code looks like it >> tries to use CLOCK_MONOTONIC if specified. From >> src/lib/libthr/thread/thr_init.c: >> >> int >> _pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t >> clock_id) { >> if (attr == NULL || *attr == NULL) >> return (EINVAL); >> if (clock_id != CLOCK_REALTIME && >> clock_id != CLOCK_VIRTUAL && >> clock_id != CLOCK_PROF && >> clock_id != CLOCK_MONOTONIC) { >> return (EINVAL); >> } >> (*attr)->c_clockid = clock_id; >> return (0); >> } >> >> Are you getting an error from pthread_condattr_setclock() or is >> it just not functioning correctly? > > The function is entirely missing from the pthread.h header. I don't use > FreeBSD but the problem arises on the version of FreeBSD used by > debian. I don't know what that is, I am afraid. The prototype has been in since Oct 2005, and is in FreeBSD version 7 and subsequent. See revision 1.40: http://www.freebsd.org/cgi/cvsweb.cgi/src/include/pthread.h http://www.freebsd.org/cgi/cvsweb.cgi/src/include/pthread.h.diff?r1=1.39;r2=1.40 -- DE