Subject: pkg/25593: Declaration of gettimeofday prevents compilation
To: None <>
From: None <>
List: pkgsrc-bugs
Date: 05/16/2004 05:15:34
>Number:         25593
>Category:       pkg
>Synopsis:       The declaration of gettimeofday() differs from that in <sys/time.h>.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 16 11:16:01 UTC 2004
>Originator:     John R. Shannon
>Release:        NetBSD 2.0E
System: NetBSD 2.0E NetBSD 2.0E (KERNEL) #0: Thu May 13 06:22:04 MDT 2004 i386
Architecture: i386
Machine: i386
	Bind defines gettimeofday() as isc__gettimeofday() which, in turn, is declared with
	a signature differing from that in <sys/time.h>. This prevents compilation of code
	where both declarations are visable. They differ in the second argument: <sys/time.h>
	has a void* while isc__gettimeofday has struct timezone*. Bind's supplied convienience 
	function ignores the second parameter so we can safely use NetBSD's declaration
	of gettimeofday(). The supplied patch does this.


--- lib/bind/       2003-06-26 21:51:35.000000000 -0600
+++ lib/bind/
@@ -358,11 +358,11 @@ void endpwent_r(void);
int setpassent(int stayopen);

-#define gettimeofday isc__gettimeofday
+#define gettimeofday isc__gettimeofday
int isc__gettimeofday(struct timeval *tvp, struct _TIMEZONE *tzp);
-int isc__gettimeofday(struct timeval *tp, struct timezone *tzp);
+#include <sys/time.h>

int getnetgrent(char **machinep, char **userp, char **domainp);

 	This prevents compilation when both declarations are visable.