From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1740 invoked by alias); 30 Nov 2004 20:42:19 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 1523 invoked from network); 30 Nov 2004 20:41:56 -0000 Received: from unknown (HELO mysicka.ms.mff.cuni.cz) (195.113.15.26) by sourceware.org with SMTP; 30 Nov 2004 20:41:56 -0000 Received: from sunsite.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by mysicka.ms.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id iAUKftm0029798; Tue, 30 Nov 2004 21:41:55 +0100 Received: (from jj@localhost) by sunsite.mff.cuni.cz (8.13.1/8.13.1/Submit) id iAUKftZB029795; Tue, 30 Nov 2004 21:41:55 +0100 Date: Tue, 30 Nov 2004 20:42:00 -0000 From: Jakub Jelinek To: Steve Munroe Cc: libc-hacker@sources.redhat.com, dgm69@us.ibm.com Subject: Re: Whats up with _POSIX_CPUTIME Message-ID: <20041130204154.GJ8259@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-SW-Source: 2004-11/txt/msg00088.txt.bz2 On Tue, Nov 30, 2004 at 02:16:08PM -0600, Steve Munroe wrote: > Whats up with _POSIX_CPUTIME and _POSIX_THREAD_CPUTIME? > > powerpc/powerpc64 builds are failing because they are undefined. So far > only i386, ia64, and x86_64 define these in posix_opt.h. > > Is these just missing #ifdef or do I need to enable something for powerpc. > If so is there a pointer to a description of this feature. http://www.opengroup.org/onlinepubs/009695399/basedefs/unistd.h.html says about these macros that they can be: 1) undefined, then sysconf() can be used to determine whether the option is present at runtime, no words about whether the headers/functions/macros/etc. are available though 2) defined to -1, then the option is not supported, headers/functions/macros/etc. need not be present 3) defined to 0, then headers/functions/macros/etc. must be present, but the option is not necessarily supported, so sysconf() should be used to detect whether the option is supported at runtime 4) defined to > 0 (200112L) - the option is unconditionally supported Now, for _POSIX_CPUTIME/_POSIX_THREAD_CPUTIME, we have the headers/functions/macros/etc. required for these options always present. On i?86/x86_64/ia64 the option is sometimes supported (so #define _POSIX_CPUTIME 0 is correct), while on ppc/ppc64/s390/s390x etc. we don't define it at all. But 1) is almost like 3) when we have the headers/data types/functions, so either we can #define these to 0 on all Linux platforms and use some other (not exported) macro to tell posix-timer.h, timer_*.c etc. whether they should attempt something or not (this would have 2 advantages, the bigger that we could unify all the linuxthreads and all the nptl posix_opt.h headers, but also that e.g. we could decide in the future to use a tick register say on ppc* on hardware that has it (do I remember well that there is something like that on some ppc's?) usable without the need to recompile apps to use it, or we can #define it to -1 to say that it is really not supported. Jakub