From andreas@syndrom23.de  Wed Oct 19 19:29:19 2005
Return-Path: <andreas@syndrom23.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 4C2A216A420
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 19 Oct 2005 19:29:19 +0000 (GMT)
	(envelope-from andreas@syndrom23.de)
Received: from vs159088.vserver.de (syndrom23.de [62.75.159.88])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9F4C543D64
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 19 Oct 2005 19:29:18 +0000 (GMT)
	(envelope-from andreas@syndrom23.de)
Received: from klamath.syndrom23.de ([212.204.44.203])
	(authenticated bits=0)
	by vs159088.vserver.de (8.12.8/8.12.8) with ESMTP id j9JJT608004576
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 19 Oct 2005 21:29:14 +0200
Message-Id: <1129750157.0@klamath.syndrom23.de>
Date: Wed, 19 Oct 2005 21:29:17 +0200
From: "Andreas Kohn" <andreas@syndrom23.de>
To: "FreeBSD gnats submit" <FreeBSD-gnats-submit@freebsd.org>
Subject: [PATCH] correct gettimeofday manpage, document one known bug
X-Send-Pr-Version: gtk-send-pr 0.4.6 
X-GNATS-Notify:

>Number:         87681
>Category:       docs
>Synopsis:       [patch] correct gettimeofday(2) manpage, document one known bug
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jcamou
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 19 19:30:15 GMT 2005
>Closed-Date:    Mon Mar 06 15:57:24 GMT 2006
>Last-Modified:  Mon Mar 06 15:57:24 GMT 2006
>Originator:     Andreas Kohn
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:


System: FreeBSD 7.0-CURRENT #35: Sun Oct  2 14:16:27 CEST 2005
    root@klamath.syndrom23.de:/usr/obj/usr/src/sys/KLAMATH



>Description:


struct timeval's tv_sec member should be time_t according to http://www.opengroup.org/onlinepubs/007908799/xsh/systime.h.html. It isn't on FreeBSD, due to alpha compatibility requirements with Tru64. 

The attached patch documents that, and also updates the description of the structs with the correct types found in _timeval.h

For more information, please consider the thread starting at 
http://lists.freebsd.org/pipermail/freebsd-hackers/2005-October/013948.html




>How-To-Repeat:


N/A


>Fix:


--- gettimeofday.2.diff begins here ---
Index: gettimeofday.2
===================================================================
RCS file: /storage/freebsd/cvs/src/lib/libc/sys/gettimeofday.2,v
retrieving revision 1.25
diff -u -r1.25 gettimeofday.2
--- gettimeofday.2	2 Jul 2004 23:52:13 -0000	1.25
+++ gettimeofday.2	8 Oct 2005 16:27:40 -0000
@@ -82,8 +82,8 @@
 .Pp
 .Bd -literal
 struct timeval {
-	long	tv_sec;		/* seconds since Jan. 1, 1970 */
-	long	tv_usec;	/* and microseconds */
+	long		tv_sec;		/* seconds since Jan. 1, 1970 */
+	suseconds_t	tv_usec;	/* and microseconds */
 };
 
 struct timezone {
@@ -133,3 +133,5 @@
 .Fn gettimeofday
 system call appeared in
 .Bx 4.2 .
+.Sh BUGS
+The tv_sec member of struct timeval should be a time_t.
--- gettimeofday.2.diff ends here ---



>Release-Note:
>Audit-Trail:

From: Andreas Kohn <andreas.kohn@gmail.com>
To: bug-followup@FreeBSD.org, andreas@syndrom23.de
Cc:  
Subject: Re: docs/87681: [patch] correct gettimeofday(2) manpage, document one known bug
Date: Sat, 11 Feb 2006 13:32:08 +0100

 The bug was fixed, and time_t is now used on all archs but alpha.
 The documentation is still incorrect w.r.t. to the types.
 
 Updated patch:
 
 --------------------
 Index: gettimeofday.2
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /storage/freebsd/cvs/src/lib/libc/sys/gettimeofday.2,v
 retrieving revision 1.25
 diff -u -r1.25 gettimeofday.2
 --- gettimeofday.2      2 Jul 2004 23:52:13 -0000       1.25
 +++ gettimeofday.2      11 Feb 2006 12:26:57 -0000
 @@ -82,8 +82,8 @@
  .Pp
  .Bd -literal
  struct timeval {
 -       long    tv_sec;         /* seconds since Jan. 1, 1970 */
 -       long    tv_usec;        /* and microseconds */
 +       time_t          tv_sec;         /* seconds since Jan. 1, 1970 */
 +       suseconds_t     tv_usec;        /* and microseconds */
  };
 
  struct timezone {
 --------------------
Responsible-Changed-From-To: freebsd-doc->jcamou  
Responsible-Changed-By: jcamou 
Responsible-Changed-When: Mon Feb 13 18:38:21 UTC 2006 
Responsible-Changed-Why:  
To me.  I have been working on this along 
with brooks@, and trhodes@. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87681 
State-Changed-From-To: open->patched  
State-Changed-By: jcamou 
State-Changed-When: Fri Mar 3 13:59:32 UTC 2006 
State-Changed-Why:  
Fixed on -CURRENT.  Set this pr as a reminder to MFC 
before 5.5-RELEASE and 6.1-RELEASE.  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87681 
State-Changed-From-To: patched->closed  
State-Changed-By: jcamou 
State-Changed-When: Mon Mar 6 15:47:04 UTC 2006 
State-Changed-Why:  
Closing PR, this cannot be merged from current yet 
since the actual code hasn't been updated.  I'll 
make sure to MFC when this happens.  Thanks for 
the submission. 

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