Subject: standards/23317: "struct timeval" is non-standard
To: None <>
From: None <>
List: netbsd-bugs
Date: 10/30/2003 15:11:29
>Number:         23317
>Category:       standards
>Synopsis:       "struct timeval" is non-standard
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 30 14:12:00 UTC 2003
>Originator:     Matthias Drochner
>Release:        NetBSD 1.6ZE
	KFA Juelich
System: NetBSD zelz26 1.6ZE NetBSD 1.6ZE (ZELZ26) #615: Tue Oct 28 19:01:30 MET 2003 drochner@zelz26:/home/drochner/netbsd/sys/arch/i386/compile/ZELZ26 i386
Architecture: i386
Machine: i386
	Citing SUSv2:
    The <sys/time.h> header defines the timeval structure that includes at least
    the following members: 
    time_t         tv_sec      seconds
    suseconds_t    tv_usec     microseconds

NetBSD has a "long" as tv_sec. time_t is always a 32-bit integer.
This is a serious problem on LP64 platforms, consider eg code like
	tm = gmtime(&tv.tv_sec);
	see above
	Change "struct timeval" accordingly. Unfortunately this leads to an
ABI change on LP64, so versioning of the affected library functions is needed.