From owner-freebsd-bugs Tue Dec 5 13:40: 8 2000 From owner-freebsd-bugs@FreeBSD.ORG Tue Dec 5 13:40:05 2000 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 812E737B402 for ; Tue, 5 Dec 2000 13:40:05 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id eB5Le5236971; Tue, 5 Dec 2000 13:40:05 -0800 (PST) (envelope-from gnats) Resent-Date: Tue, 5 Dec 2000 13:40:05 -0800 (PST) Resent-Message-Id: <200012052140.eB5Le5236971@freefall.freebsd.org> Resent-From: gnats-admin@FreeBSD.org (GNATS Management) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: gnats-admin@FreeBSD.org, jonathan@graehl.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 2697B37B401 for ; Tue, 5 Dec 2000 13:36:21 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id eB5LaL936493; Tue, 5 Dec 2000 13:36:21 -0800 (PST) (envelope-from nobody) Message-Id: <200012052136.eB5LaL936493@freefall.freebsd.org> Date: Tue, 5 Dec 2000 13:36:21 -0800 (PST) From: jonathan@graehl.org Sender: nobody@FreeBSD.org To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/23304: POSIX clock_gettime, clock_getres return errno invalid argument for CLOCK_PROF and CLOCK_VIRTUAL Resent-Sender: gnats@FreeBSD.org Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 23304 >Category: kern >Synopsis: POSIX clock_gettime, clock_getres return errno invalid argument for CLOCK_PROF and CLOCK_VIRTUAL >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Dec 05 13:40:01 PST 2000 >Closed-Date: >Last-Modified: >Originator: Jonathan Graehl >Release: 4.2-STABLE >Organization: >Environment: FreeBSD 3jane 4.2-STABLE FreeBSD 4.2-STABLE #0: Sat Dec 2 14:46:10 PST 2000 root@3jane:/ext/obj/usr/src/sys/NEWJANE i386 >Description: While there is no problem with CLOCK_REALTIME, POSIX clock_gettime, clock_getres return errno invalid argument for CLOCK_PROF and CLOCK_VIRTUAL, which are documented in the man pages (section 2) as being user+system and user time, respectively. >How-To-Repeat: /* demonstrates that the clock_get... calls succed for CLOCK_REALTIME but fail for CLOCK_PROF and CLOCK_VIRTUAL */ #include #include int main() { struct timespec t; puts("CLOCK_PROF"); if (clock_gettime(CLOCK_PROF, &t)) perror(NULL); if (clock_getres(CLOCK_PROF, &t)) perror(NULL); puts("\nCLOCK_VIRTUAL"); if (clock_gettime(CLOCK_VIRTUAL, &t)) perror(NULL); if (clock_getres(CLOCK_VIRTUAL, &t)) perror(NULL); puts("\nCLOCK_REALTIME"); if (clock_gettime(CLOCK_REALTIME, &t)) perror(NULL); if (clock_getres(CLOCK_REALTIME, &t)) perror(NULL); } >Fix: Immediate fix: remove mention of CLOCK_VIRTUAL AND CLOCK_PROF from sys/time.h and man 2 clock_gettime Real fix: implement the documented POSIX functionality >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message