Index: /trunk/src/emx/include/sys/_types.h
===================================================================
--- /trunk/src/emx/include/sys/_types.h	(revision 2059)
+++ /trunk/src/emx/include/sys/_types.h	(revision 2060)
@@ -24,9 +24,9 @@
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/sys/_types.h,v 1.14 2003/03/28 15:27:30 mike Exp $
+ * $FreeBSD: src/sys/sys/_types.h,v 1.19 2004/06/19 17:58:32 marcel Exp $
  */
 
 /** @file
- * FreeBSD 5.1
+ * FreeBSD 5.3
  *
  * @changed off_t to 32bit and mode to 32bit.
@@ -57,4 +57,5 @@
 #endif
 typedef	long		__key_t;	/* IPC key (for Sys V IPC) */
+typedef	__int32_t	__lwpid_t;	/* Thread ID (a.k.a. LWP) */
 #if 1 /* bird: emx */
 typedef	__int32_t	__mode_t;	/* permissions */
@@ -64,9 +65,5 @@
 typedef	int		__nl_item;
 typedef	__uint16_t	__nlink_t;	/* link count */
-#if 0 /* bird: emx */
-typedef	__int32_t	__off_t;	/* file offset */
-#else
 typedef	__int64_t	__off_t;	/* file offset */
-#endif
 typedef	__int32_t	__pid_t;	/* process [group] */
 typedef	__int64_t	__rlim_t;	/* resource limit (XXX not unsigned) */
@@ -75,5 +72,4 @@
 typedef	long		__suseconds_t;	/* microseconds (signed) */
 typedef	__int32_t	__timer_t;	/* timer_gettime()... */
-typedef	__uint32_t	__udev_t;	/* device number */
 typedef	__uint32_t	__uid_t;
 typedef	unsigned int	__useconds_t;	/* microseconds (unsigned) */
@@ -97,22 +93,16 @@
  * character set plus one extra value (WEOF), and must be at least 16 bits.
  */
-typedef	int		__ct_rune_t;
-typedef	__ct_rune_t	__rune_t;
+typedef	int		__ct_rune_t;	/* arg type for ctype funcs */
+typedef	__ct_rune_t	__rune_t;	/* rune_t (see above) */
 #if 0 /* bird: wchar_t is usually 2 bytes on OS/2. (might change this later!) */
-typedef	__ct_rune_t	__wchar_t;
+typedef	__ct_rune_t	__wchar_t;	/* wchar_t (see above) */
 #else /* bird */
 typedef	unsigned short  __wchar_t;
 #endif /* bird */
-typedef	__ct_rune_t	__wint_t;
+typedef	__ct_rune_t	__wint_t;	/* wint_t (see above) */
 
-/*
- * dev_t has differing meanings in userland and the kernel.
- */
-#ifdef _KERNEL
-struct cdev;
-typedef	struct cdev	*__dev_t;
-#else
-typedef	__udev_t	__dev_t;		/* device number */
-#endif
+typedef	__uint32_t	__dev_t;	/* device number */
+
+typedef	__uint32_t	__fixpt_t;	/* fixed point number */
 
 /*
@@ -122,5 +112,5 @@
 typedef union {
 	char		__mbstate8[128];
-	__int64_t	_mbstateL;		/* for alignment */
+	__int64_t	_mbstateL;	/* for alignment */
 } __mbstate_t;
 
Index: /trunk/src/emx/include/sys/resource.h
===================================================================
--- /trunk/src/emx/include/sys/resource.h	(revision 2059)
+++ /trunk/src/emx/include/sys/resource.h	(revision 2060)
@@ -11,8 +11,4 @@
  *    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
@@ -32,9 +28,9 @@
  *
  *	@(#)resource.h	8.4 (Berkeley) 1/9/95
- * $FreeBSD: src/sys/sys/resource.h,v 1.19 2003/02/16 13:30:29 phk Exp $
+ * $FreeBSD: src/sys/sys/resource.h,v 1.23 2004/06/13 22:07:58 das Exp $
  */
 
 /** @file
- * FreeBSD 5.1
+ * FreeBSD 5.3
  * @changed bird: get/setpriority takes id_t not int according to SuS.
  */
@@ -43,4 +39,8 @@
 #define	_SYS_RESOURCE_H_
 
+#include <sys/cdefs.h>
+#include <sys/_timeval.h>
+#include <sys/_types.h>
+
 /*
  * Process priority specifications to get/setpriority.
@@ -48,7 +48,4 @@
 #define	PRIO_MIN	-20
 #define	PRIO_MAX	20
-#ifdef _KERNEL
-#define	PRIO_TOTAL	(PRIO_MAX - PRIO_MIN)
-#endif /* _KERNEL */
 
 #define	PRIO_PROCESS	0
@@ -98,8 +95,10 @@
 #define	RLIMIT_SBSIZE	9		/* maximum size of all socket buffers */
 #define RLIMIT_VMEM	10		/* virtual process size (inclusive of mmap) */
+#define	RLIMIT_AS	RLIMIT_VMEM	/* standard name for RLIMIT_VMEM */
 
 #define	RLIM_NLIMITS	11		/* number of resource limits */
 
 #define	RLIM_INFINITY	((rlim_t)(((u_quad_t)1 << 63) - 1))
+/* XXX Missing: RLIM_SAVED_MAX, RLIM_SAVED_CUR */
 
 
@@ -124,8 +123,8 @@
 #endif
 
-struct orlimit {
-	int32_t	rlim_cur;		/* current (soft) limit */
-	int32_t	rlim_max;		/* maximum value for rlim_cur */
-};
+#ifndef _RLIM_T_DECLARED
+typedef	__rlim_t	rlim_t;
+#define	_RLIM_T_DECLARED
+#endif
 
 struct rlimit {
@@ -134,8 +133,14 @@
 };
 
-/* Load average structure. */
+#if __BSD_VISIBLE
+
+struct orlimit {
+	__int32_t	rlim_cur;	/* current (soft) limit */
+	__int32_t	rlim_max;	/* maximum value for rlim_cur */
+};
+
 struct loadavg {
-	fixpt_t	ldavg[3];
-	long	fscale;
+	__fixpt_t	ldavg[3];
+	long		fscale;
 };
 
@@ -147,14 +152,16 @@
 #define	CPUSTATES	5
 
+#endif	/* __BSD_VISIBLE */
+
 #ifdef _KERNEL
 extern struct loadavg averunnable;
 extern long cp_time[CPUSTATES];
 
-int	dosetrlimit(struct thread *, u_int, struct rlimit *);
+int	kern_setrlimit(struct thread *, u_int, struct rlimit *);
 
 #else
-#include <sys/cdefs.h>
 
 __BEGIN_DECLS
+/* XXX 2nd arg to [gs]etpriority() should be an id_t */
 int	getpriority(int, /*int*/ id_t);         /* bird: SuS uses id_t */
 int	getrlimit(int, struct rlimit *);
Index: /trunk/src/emx/include/sys/stat.h
===================================================================
--- /trunk/src/emx/include/sys/stat.h	(revision 2059)
+++ /trunk/src/emx/include/sys/stat.h	(revision 2060)
@@ -16,8 +16,4 @@
  *    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
@@ -37,9 +33,9 @@
  *
  *	@(#)stat.h	8.12 (Berkeley) 6/16/95
- * $FreeBSD: src/sys/sys/stat.h,v 1.37 2003/05/22 17:07:57 mike Exp $
+ * $FreeBSD: src/sys/sys/stat.h,v 1.40 2004/06/17 17:16:52 phk Exp $
  */
 
 /** @file
- * FreeBSD 5.1
+ * FreeBSD 5.3
  * @changed	bird: EMX isms and hid the BSD specific structs and related stuff.
  * @changed     bird: No UF_ and SF_ because we ain't got any st_flags.
@@ -140,5 +136,5 @@
 
 struct stat {
-	__udev_t  st_dev;		/* inode's device */
+	__dev_t   st_dev;		/* inode's device */
 	ino_t	  st_ino;		/* inode's number */
 	mode_t	  st_mode;		/* inode protection mode */
@@ -146,5 +142,5 @@
 	uid_t	  st_uid;		/* user ID of the file's owner */
 	gid_t	  st_gid;		/* group ID of the file's group */
-	__udev_t  st_rdev;		/* device type */
+	__dev_t   st_rdev;		/* device type */
 #if 1 /* bird: emx */
 	time_t	  st_atime;
@@ -199,5 +195,5 @@
 #if __BSD_VISIBLE
 struct nstat {
-	__udev_t st_dev;		/* inode's device */
+	__dev_t   st_dev;		/* inode's device */
 	ino_t	  st_ino;		/* inode's number */
 	__uint32_t st_mode;		/* inode protection mode */
@@ -205,5 +201,5 @@
 	uid_t	  st_uid;		/* user ID of the file's owner */
 	gid_t	  st_gid;		/* group ID of the file's group */
-	__udev_t st_rdev;		/* device type */
+	__dev_t   st_rdev;		/* device type */
 	struct	timespec st_atimespec;	/* time of last access */
 	struct	timespec st_mtimespec;	/* time of last data modification */
@@ -370,3 +366,2 @@
 
 #endif /* !_SYS_STAT_H_ */
-
Index: /trunk/src/emx/include/sys/types.h
===================================================================
--- /trunk/src/emx/include/sys/types.h	(revision 2059)
+++ /trunk/src/emx/include/sys/types.h	(revision 2060)
@@ -16,8 +16,4 @@
  *    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
@@ -37,9 +33,9 @@
  *
  *	@(#)types.h	8.6 (Berkeley) 2/19/95
- * $FreeBSD: src/sys/sys/types.h,v 1.83 2003/03/28 15:27:30 mike Exp $
+ * $FreeBSD: src/sys/sys/types.h,v 1.90 2004/06/19 17:58:32 marcel Exp $
  */
 
 /** @file
- * FreeBSD 5.1
+ * FreeBSD 5.3
  *
  * @changed bird: Some EMX defines and a bit of toolkit pollution.
@@ -64,6 +60,8 @@
 typedef	unsigned int	u_int;
 typedef	unsigned long	u_long;
+#ifndef _KERNEL
 typedef	unsigned short	ushort;		/* Sys V compatibility */
 typedef	unsigned int	uint;		/* Sys V compatibility */
+#endif
 #endif
 
@@ -154,5 +152,5 @@
 #endif
 
-typedef	__uint32_t	fixpt_t;	/* fixed point number */
+typedef	__fixpt_t	fixpt_t;	/* fixed point number */
 
 #ifndef _FSBLKCNT_T_DECLARED		/* for statvfs() */
@@ -194,4 +192,9 @@
 #endif
 
+#ifndef _LWPID_T_DECLARED
+typedef	__lwpid_t	lwpid_t;	/* Thread ID (a.k.a. LWP) */
+#define	_LWPID_T_DECLARED
+#endif
+
 #ifndef _MODE_T_DECLARED
 typedef	__mode_t	mode_t;		/* permissions */
@@ -254,5 +257,4 @@
 
 typedef	__u_register_t	u_register_t;
-typedef	__udev_t	udev_t;		/* device number */
 
 #if !defined(_UID_T_DECLARED) && !defined(_UID_T)  /* bird: emx */
@@ -275,4 +277,5 @@
 #ifdef _KERNEL
 typedef	int		boolean_t;
+typedef	__cpumask_t	cpumask_t;
 typedef	__intfptr_t	intfptr_t;
 
@@ -312,6 +315,7 @@
 #define major(x)        ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
 #define minor(x)        ((int)((x)&0xffff00ff))         /* minor number */
+#endif /* !_KERNEL */
+
 #define makedev(x,y)    ((dev_t)(((x) << 8) | (y)))     /* create dev_t */
-#endif /* !_KERNEL */
 
 /*
