Bug 87681

Summary: [patch] correct gettimeofday(2) manpage, document one known bug
Product: Documentation Reporter: Andreas Kohn <andreas>
Component: Books & ArticlesAssignee: jcamou
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
gettimeofday.2.diff none

Description Andreas Kohn 2005-10-19 20:30:15 UTC

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
Comment 1 andreas.kohn 2006-02-11 12:32:08 UTC
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 {
--------------------
Comment 2 jcamou freebsd_committer freebsd_triage 2006-02-13 18:38:21 UTC
Responsible Changed
From-To: freebsd-doc->jcamou

To me.  I have been working on this along 
with brooks@, and trhodes@.
Comment 3 jcamou freebsd_committer freebsd_triage 2006-03-03 13:59:32 UTC
State Changed
From-To: open->patched

Fixed on -CURRENT.  Set this pr as a reminder to MFC 
before 5.5-RELEASE and 6.1-RELEASE.  Thanks!
Comment 4 jcamou freebsd_committer freebsd_triage 2006-03-06 15:47:04 UTC
State Changed
From-To: patched->closed

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.