From owner-freebsd-standards@FreeBSD.ORG Sat Apr 17 21:02:24 2010 Return-Path: Delivered-To: standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A0C8106566C for ; Sat, 17 Apr 2010 21:02:24 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 20AAF8FC15 for ; Sat, 17 Apr 2010 21:02:24 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 7C22135A82C; Sat, 17 Apr 2010 23:02:23 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 7155A1738D; Sat, 17 Apr 2010 23:02:23 +0200 (CEST) Date: Sat, 17 Apr 2010 23:02:23 +0200 From: Jilles Tjoelker To: Garrett Wollman Message-ID: <20100417210223.GA41384@stack.nl> References: <19398.2606.92468.700955@khavrinen.csail.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19398.2606.92468.700955@khavrinen.csail.mit.edu> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Garrett Cooper , standards@freebsd.org Subject: Re: Non-POSIX compliant portions of FreeBSD X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2010 21:02:24 -0000 On Wed, Apr 14, 2010 at 02:32:14PM -0400, Garrett Wollman wrote: > < said: > > > I was recently piqued by Warner to look into open_posix_testsuite, > > and I've noticed that there are some discrepancies in our compliance > > with POSIX standards: > > Please take note of the broad variety of options in the POSIX > specification. There are many options which we do not implement, > either because they are bad ideas (e.g., XSI, tracing), or because > nobody has gotten around to implementing them (e.g., synchronous > I/O). A correct application will check (using getconf(1), sysconf(3), > or both) whether the interface it desires is available before > attempting to use it. A broken application will use autoconf. > > 7. We don't have clock_nanosleep, clock_getcpuclockid, or getdate > > defined using the POSIX defined headers. > POSIX_CLOCK_SELECTION option group. clock_nanosleep is in the base in the 2008 version (SUSv4); the previous POSIX_CLOCK_SELECTION option is now required. Implementing clock_nanosleep requires a new in-kernel facility to sleep until a certain CLOCK_REALTIME value in such a way that setting the clock forwards makes it wake up earlier and vice versa (in particular, the thread needs to be woken up immediately if the clock is stepped beyond the specified absolute time). pthread_cond_timedwait() (unless the application has selected the CLOCK_MONOTONIC clock), pthread_mutex_timedlock(), pthread_rwlock_timedrdlock(), pthread_rwlock_timedwrlock(), mq_timedsend(), mq_timedreceive() and maybe more are also specified to sleep in this manner, but FreeBSD effectively uses CLOCK_MONOTONIC timing for them, except that some of them will correctly sleep longer if the clock has been set backwards. This error probably has little practical effect, but clock_nanosleep() doesn't really add anything above nanosleep() if it does not implement absolute CLOCK_REALTIME sleeps. clock_getcpuclockid is part of the _POSIX_CPUTIME option. Most of the functionality of this option can be obtained via setitimer(ITIMER_PROF), clock_gettime(CLOCK_PROF), getrusage() and kvm_getprocs(). getdate is in the XSI option group. -- Jilles Tjoelker