From nobody@FreeBSD.org  Tue Dec  5 13:36:21 2000
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 2697B37B401
	for <freebsd-gnats-submit@FreeBSD.org>; 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
Subject: POSIX clock_gettime, clock_getres return errno invalid argument for CLOCK_PROF and CLOCK_VIRTUAL
X-Send-Pr-Version: www-1.0

>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:    kbyanc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 05 13:40:01 PST 2000
>Closed-Date:    Fri Mar 09 00:18:40 GMT 2007
>Last-Modified:  Fri Mar 09 00:18:40 GMT 2007
>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 <sys/time.h>
#include <stdio.h>

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:
Responsible-Changed-From-To: freebsd-bugs->freebsd-standards 
Responsible-Changed-By: mike 
Responsible-Changed-When: Tue Jun 4 19:51:47 PDT 2002 
Responsible-Changed-Why:  

This is a standards issue. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=23304 
Responsible-Changed-From-To: freebsd-standards->standards 
Responsible-Changed-By: johan 
Responsible-Changed-When: Sat Aug 24 19:05:18 PDT 2002 
Responsible-Changed-Why:  
Use short names for mailing list to make searches    
using the web query form work with the shown responsible. 

This also makes open PR show up in the summery mail. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=23304 
Responsible-Changed-From-To: standards->freebsd-standards 
Responsible-Changed-By: des 
Responsible-Changed-When: Tue Feb 17 07:46:15 PST 2004 
Responsible-Changed-Why:  
Misattributed PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=23304 
State-Changed-From-To: open->patched 
State-Changed-By: kbyanc 
State-Changed-When: Thu Jun 17 23:22:42 GMT 2004 
State-Changed-Why:  
Committed support for CLOCK_VIRTUAL and CLOCK_PROF to -current. 


Responsible-Changed-From-To: freebsd-standards->	 kbyanc 
Responsible-Changed-By: kbyanc 
Responsible-Changed-When: Thu Jun 17 23:22:42 GMT 2004 
Responsible-Changed-Why:  
I'll take this in order to help remember I need to do the MFC. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=23304 
State-Changed-From-To: patched->closed 
State-Changed-By: linimon 
State-Changed-When: Fri Mar 9 00:16:28 UTC 2007 
State-Changed-Why:  
What was -current at the time of this PR was made -stable long ago, so this 
PR is OBE. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=23304 
>Unformatted:
