Index: trunk/src/emx/include/386/_types.h
===================================================================
--- trunk/src/emx/include/386/_types.h	(revision 900)
+++ trunk/src/emx/include/386/_types.h	(revision 902)
@@ -102,9 +102,5 @@
 #endif
 typedef	__int32_t	__ssize_t;		/* byte count or error */
-#if 1 /* bird: emx */
-typedef	unsigned long	__time_t;		/* time()... */
-#else
 typedef	__int32_t	__time_t;		/* time()... */
-#endif
 typedef	__uint32_t	__uintfptr_t;
 typedef	__uint64_t	__uintmax_t;
Index: trunk/src/emx/include/emx/time.h
===================================================================
--- trunk/src/emx/include/emx/time.h	(revision 900)
+++ trunk/src/emx/include/emx/time.h	(revision 902)
@@ -4,14 +4,19 @@
 #define _EMX_TIME_H
 
+#include <sys/cdefs.h>
+#include <sys/_types.h>
+
 #if defined (__cplusplus)
 extern "C" {
 #endif
 
-#define _YEARS          (2106 - 1970 + 1)
-#define TIME_T_MAX      0xffffffffUL
+#define _YEARS          (2059 - 1900 + 1)
+#define TIME_T_MAX      0x7fffffffL
+#define TIME_T_MIN      (-0x7fffffffL - 1)
 
-#if !defined (_TIME_T)
-#define _TIME_T
-typedef unsigned long time_t;
+#if !defined(_TIME_T_DECLARED) && !defined(_TIME_T) /* bird: EMX */
+typedef	__time_t	time_t;
+#define	_TIME_T_DECLARED
+#define _TIME_T                         /* bird: EMX */
 #endif
 
@@ -33,5 +38,5 @@
 extern struct _tzinfo _tzi;
 
-extern unsigned short const _year_day[_YEARS+1];
+extern signed short const   _year_day[_YEARS+1];
 extern unsigned short const _month_day_leap[];
 extern unsigned short const _month_day_non_leap[];
@@ -39,8 +44,8 @@
 
 int _day (int, int, int);
-int _gmt2loc (unsigned long *);
-int _loc2gmt (unsigned long *, int);
-struct tm *_gmtime (struct tm *, const time_t *);
-struct tm *_localtime (struct tm *, const time_t *);
+int _gmt2loc (time_t *);
+int _loc2gmt (time_t *, int);
+/* struct tm *_gmtime (struct tm *, const time_t *); - use gmtime_r */
+/* struct tm *_localtime (struct tm *, const time_t *); - use localtime_r */
 unsigned long _mktime (struct tm *);
 void _compute_dst_table (void);
Index: trunk/src/emx/include/sys/utime.h
===================================================================
--- trunk/src/emx/include/sys/utime.h	(revision 900)
+++ trunk/src/emx/include/sys/utime.h	(revision 902)
@@ -1,32 +1,67 @@
-/* sys/utime.h (emx+gcc) */
 
-#ifndef _SYS_UTIME_H
-#define _SYS_UTIME_H
+/*-
+ * Copyright (c) 1990, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)utime.h	8.1 (Berkeley) 6/2/93
+ * $FreeBSD: src/include/utime.h,v 1.5 2002/08/24 00:11:52 mike Exp $
+ */
 
-#if defined (__cplusplus)
-extern "C" {
+/** @file
+ * FreeBSD 5.1
+ * @changed bird: the usual emx stuff.
+ */
+
+#ifndef	_UTIME_H_
+#define	_UTIME_H_
+
+#include <sys/cdefs.h>
+#include <sys/_types.h>
+
+#if !defined(_TIME_T_DECLARED) && !defined(_TIME_T) /* bird: emx */
+typedef	__time_t	time_t;
+#define	_TIME_T_DECLARED
+#define _TIME_T                         /* bird: emx */
 #endif
 
-#if !defined (_TIME_T)
-#define _TIME_T
-typedef unsigned long time_t;
-#endif
+struct utimbuf {
+	time_t actime;		/* Access time */
+	time_t modtime;		/* Modification time */
+};
 
-#if !defined (_UTIMBUF)
-#define _UTIMBUF
-struct utimbuf
-{
-  time_t actime;
-  time_t modtime;
-};
-#endif
+__BEGIN_DECLS
+int utime(const char *, const struct utimbuf *);
+/* bird: emx */
+int _utime(const char *, const struct utimbuf *);
+__END_DECLS
 
-int utime (__const__ char *, __const__ struct utimbuf *);
+#endif /* !_UTIME_H_ */
 
-int _utime (__const__ char *, __const__ struct utimbuf *);
-
-#if defined (__cplusplus)
-}
-#endif
-
-#endif /* not _SYS_UTIME_H */
Index: trunk/src/emx/include/unistd.h
===================================================================
--- trunk/src/emx/include/unistd.h	(revision 900)
+++ trunk/src/emx/include/unistd.h	(revision 902)
@@ -391,5 +391,5 @@
 /** @todo extern int optreset; */			/* getopt(3) external variable */
 #endif /* __BSD_VISIBLE */
-/////
+
 
 #if !defined(_POSIX_SOURCE)
