Index: ar.h
--- ar.h.orig	1993-05-01 06:04:22.000000000 +0200
+++ ar.h	2004-05-27 21:08:48.000000000 +0200
@@ -15,10 +15,12 @@
 /* uchar should be 8 bits or more */
 /* typedef unsigned char  uchar;   -- already in zoo.h */
 
+#if !(defined(__FreeBSD__) && __FreeBSD__ < 3) && !defined(__OpenBSD__) && !defined(__NetBSD__)
 typedef unsigned int   uint;    /* 16 bits or more */
 #if !defined(__386BSD__) || !defined(_TYPES_H_)
 typedef unsigned short ushort;  /* 16 bits or more */
 #endif
+#endif
 typedef unsigned long  ulong;   /* 32 bits or more */
 
 /* T_UINT16 must be #defined in options.h to be 
Index: bsd.c
--- bsd.c.orig	1993-05-01 06:21:53.000000000 +0200
+++ bsd.c	2004-05-27 21:08:48.000000000 +0200
@@ -69,8 +69,12 @@
 }
 
 /* Function gettz() returns the offset from GMT in seconds */
-long gettz()
+long gettz(t)
+long t;
 {
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+   return -localtime(&t)->tm_gmtoff;
+#else
 #define SEC_IN_DAY	(24L * 60L * 60L)
 #define INV_VALUE		(SEC_IN_DAY + 1L)
 	static long retval = INV_VALUE;	     /* cache, init to impossible value */
@@ -95,6 +99,7 @@
 	retval = -tm->tm_gmtoff;
 #endif
 	return retval;
+#endif
 }
 
 /* Standard UNIX-compatible time routines */
@@ -103,15 +108,19 @@
 /* Standard UNIX-specific file attribute routines */
 #include "nixmode.i"
 
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+#include <unistd.h>
+#else
 #ifndef SEEK_CUR
 # define  SEEK_CUR    1
 #endif
+#endif
 
 /* Truncate a file. */
 int zootrunc(f) FILE *f;
 {
-	extern long lseek();
-	long seekpos;
+	extern off_t lseek();
+	off_t seekpos;
 	int fd = fileno(f);
 	seekpos = lseek(fd, 0L, SEEK_CUR);
 	if (seekpos >= 0)
Index: misc2.c
--- misc2.c.orig	1991-07-16 17:53:02.000000000 +0200
+++ misc2.c	2004-05-27 21:08:48.000000000 +0200
@@ -314,10 +314,12 @@
 {
 	long diff_tz;
 	long longtime;
+	long t;
 	if (direntry->tz == NO_TZ)		/* none stored */
 		return;
-	diff_tz = (long) direntry->tz * (3600/4) - gettz(); /* diff. in seconds */
-	longtime = mstonix (direntry->date, direntry->time) + diff_tz; /* adj tz */
+	t = mstonix (direntry->date, direntry->time);
+	diff_tz = (long) direntry->tz * (3600/4) - gettz(t); /* diff. in seconds */
+	longtime = t + diff_tz; /* adj tz */
 	mstime (longtime, &direntry->date, &direntry->time);
 }
 #endif /* GETTZ */
Index: nixtime.i
--- nixtime.i.orig	1991-07-16 17:53:46.000000000 +0200
+++ nixtime.i	2004-05-27 21:08:48.000000000 +0200
@@ -52,7 +52,8 @@
 	long mstonix();
 	long gettz();
 	long utimbuf[2];
-	utimbuf[0] = utimbuf[1] = gettz() + mstonix (date, time);
+	long t = mstonix (date, time);
+	utimbuf[0] = utimbuf[1] = t + gettz(t);
 	return (utime (path, utimbuf));
 }
 
Index: options.h
--- options.h.orig	1993-05-01 06:27:59.000000000 +0200
+++ options.h	2004-05-27 21:08:48.000000000 +0200
@@ -96,7 +96,6 @@
 #define NIXTIME
 #define NIXFNAME
 #define NEEDCTYP
-#define NOENUM
 #define REN_STDC
 #define SETBUF
 #define GETTZ
@@ -110,6 +109,7 @@
 #define ANSI_PROTO
 #define VOIDPTR		void *
 #else
+#define NOENUM
 #define NOSTRCHR /* not really needed for 4.3BSD */
 #define T_SIGNAL	int
 #define VARARGS
Index: zooadd2.c
--- zooadd2.c.orig	1991-07-20 01:38:10.000000000 +0200
+++ zooadd2.c	2004-05-27 21:08:48.000000000 +0200
@@ -258,12 +258,15 @@
 register struct direntry *direntry;
 {
 #ifdef GETTZ
+	long mstonix();
 	long gettz();
+	long t;
 #endif
    direntry->zoo_tag = ZOO_TAG;
    direntry->type = 2;                  /* type is now 2 */
 #ifdef GETTZ
-	direntry->tz = gettz() / (15 * 60); /* seconds => 15-min units */
+	t = mstonix (direntry->date, direntry->time);
+	direntry->tz = gettz(t) / (15 * 60); /* seconds => 15-min units */
 #else
    direntry->tz = NO_TZ;                /* timezone unknown */
 #endif
Index: zoofns.h
--- zoofns.h.orig	1993-05-01 05:57:35.000000000 +0200
+++ zoofns.h	2004-05-27 21:08:48.000000000 +0200
@@ -94,7 +94,11 @@
 void fixslash PARMS ((char *));
 void makelist PARMS ((int, char *[], char *[], int, char *, char *, char *, int *));
 void memerr PARMS ((unsigned int));
+#ifdef STDARG
+void prterror(int level, char *format, ...);
+#else
 void prterror PARMS ((int, char *, ...));
+#endif
 void rootname PARMS ((char *, char *));
 void skip_files PARMS ((ZOOFILE, unsigned int *, unsigned int *, int *,
                   char [], long *));
Index: zoolist.c
--- zoolist.c.orig	1991-07-20 00:57:27.000000000 +0200
+++ zoolist.c	2004-05-27 21:08:48.000000000 +0200
@@ -539,10 +539,12 @@
 {
 	long gettz();
 	int diff_tz;				/* timezone difference */
+	long t;
 	if (file_tz == NO_TZ) 	/* if no timezone stored ..*/
 		printf ("   ");			/* .. just pad with blanks */
 	else {
-		diff_tz = (file_tz / 4) - (int) (gettz() / 3600);
+		time(&t);
+		diff_tz = (file_tz / 4) - (int) (gettz(t) / 3600);
 		if (diff_tz == 0)
 			printf ("   ");					/* print nothing if same */
 		else if (diff_tz > 0)			/* else print signed difference */
