Index: trunk/src/emx/include/InnoTekLIBC/backend.h
===================================================================
--- trunk/src/emx/include/InnoTekLIBC/backend.h	(revision 1602)
+++ trunk/src/emx/include/InnoTekLIBC/backend.h	(revision 1603)
@@ -427,4 +427,23 @@
 /** @} */
 
+
+/** @defgroup __libc_Back_MMan      LIBC Backend - Memory Management
+ * @{ */
+
+/**
+ * Change the memory protection attributes of a range of pages.
+ * This function supports the crossing of object boundaries and works
+ * on any memory the native apis works on.
+ *
+ * @returns Negative error code (errno.h) on failure.
+ * @param   pv      Pointer to first page - page aligned!
+ * @param   cb      Size of the ranage - page aligned!
+ * @param   fFlags  The PROT_* flags to replace the current flags with.
+ */
+int __libc_Back_mmanProtect(void *pv, size_t cb, unsigned fFlags);
+
+/** @} */
+
+
 __END_DECLS
 
Index: trunk/src/emx/include/InnoTekLIBC/logstrict.h
===================================================================
--- trunk/src/emx/include/InnoTekLIBC/logstrict.h	(revision 1602)
+++ trunk/src/emx/include/InnoTekLIBC/logstrict.h	(revision 1603)
@@ -181,8 +181,12 @@
 /** Environment APIs. */
 #define __LIBC_LOG_GRP_ENV          15
-
-/** Backend FS APIs. */
+/** Memory Manager APIs. */
+#define __LIBC_LOG_GRP_MMAN         16
+
+/** Backend Memory Mananger APIs. */
+#define __LIBC_LOG_GRP_BACK_MMAN    21
+/** Backend Loader APIs. */
 #define __LIBC_LOG_GRP_BACK_LDR     22
-/** Backend FS APIs. */
+/** Backend Filesystem APIs. */
 #define __LIBC_LOG_GRP_BACK_FS      23
 /** Shared Process Database and LIBC Shared Memory APIs. */
Index: trunk/src/emx/include/sys/mman.h
===================================================================
--- trunk/src/emx/include/sys/mman.h	(revision 1603)
+++ trunk/src/emx/include/sys/mman.h	(revision 1603)
@@ -0,0 +1,204 @@
+/** @file
+ * FreeBSD 5.2
+ * @changed bird: disabled most of the stuff we don't implement yet.
+ */
+/*-
+ * Copyright (c) 1982, 1986, 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.
+ * 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.
+ *
+ *	@(#)mman.h	8.2 (Berkeley) 1/9/95
+ * $FreeBSD: src/sys/sys/mman.h,v 1.39 2004/04/27 13:13:20 mux Exp $
+ */
+
+#ifndef _SYS_MMAN_H_
+#define _SYS_MMAN_H_
+
+#include <sys/cdefs.h>
+#include <sys/_types.h>
+
+#if 0  /* bird */
+#if __BSD_VISIBLE
+/*
+ * Inheritance for minherit()
+ */
+#define INHERIT_SHARE	0
+#define INHERIT_COPY	1
+#define INHERIT_NONE	2
+#endif
+#endif /* bird */
+
+/*
+ * Protections are chosen from these bits, or-ed together
+ */
+#define	PROT_NONE	0x00	/* no permissions */
+#define	PROT_READ	0x01	/* pages can be read */
+#define	PROT_WRITE	0x02	/* pages can be written */
+#define	PROT_EXEC	0x04	/* pages can be executed */
+
+#if 0  /* bird */
+/*
+ * Flags contain sharing type and options.
+ * Sharing types; choose one.
+ */
+#define	MAP_SHARED	0x0001		/* share changes */
+#define	MAP_PRIVATE	0x0002		/* changes are private */
+#define	MAP_COPY	MAP_PRIVATE	/* Obsolete */
+
+#if __BSD_VISIBLE
+/*
+ * Other flags
+ */
+#define	MAP_FIXED	 0x0010	/* map addr must be exactly as requested */
+#define	MAP_RENAME	 0x0020	/* Sun: rename private pages to file */
+#define	MAP_NORESERVE	 0x0040	/* Sun: don't reserve needed swap area */
+#define	MAP_RESERVED0080 0x0080	/* previously misimplemented MAP_INHERIT */
+#define	MAP_RESERVED0100 0x0100	/* previously unimplemented MAP_NOEXTEND */
+#define	MAP_HASSEMAPHORE 0x0200	/* region may contain semaphores */
+#define	MAP_STACK	 0x0400	/* region grows down, like a stack */
+#define	MAP_NOSYNC	 0x0800 /* page to but do not sync underlying file */
+
+/*
+ * Mapping type
+ */
+#define	MAP_FILE	 0x0000	/* map from file (default) */
+#define	MAP_ANON	 0x1000	/* allocated from memory, swap space */
+
+/*
+ * Extended flags
+ */
+#define	MAP_NOCORE	 0x00020000 /* dont include these pages in a coredump */
+#endif /* __BSD_VISIBLE */
+
+#if __POSIX_VISIBLE >= 199309
+/*
+ * Process memory locking
+ */
+#define MCL_CURRENT	0x0001	/* Lock only current memory */
+#define MCL_FUTURE	0x0002	/* Lock all future memory as well */
+#endif
+
+/*
+ * Error return from mmap()
+ */
+#define MAP_FAILED	((void *)-1)
+
+/*
+ * msync() flags
+ */
+#define	MS_SYNC		0x0000	/* msync synchronously */
+#define MS_ASYNC	0x0001	/* return immediately */
+#define MS_INVALIDATE	0x0002	/* invalidate all cached data */
+
+#if __BSD_VISIBLE
+/*
+ * Advice to madvise
+ */
+#define	MADV_NORMAL	0	/* no further special treatment */
+#define	MADV_RANDOM	1	/* expect random page references */
+#define	MADV_SEQUENTIAL	2	/* expect sequential page references */
+#define	MADV_WILLNEED	3	/* will need these pages */
+#define	MADV_DONTNEED	4	/* dont need these pages */
+#define	MADV_FREE	5	/* dont need these pages, and junk contents */
+#define	MADV_NOSYNC	6	/* try to avoid flushes to physical media */
+#define	MADV_AUTOSYNC	7	/* revert to default flushing strategy */
+#define	MADV_NOCORE	8	/* do not include these pages in a core file */
+#define	MADV_CORE	9	/* revert to including pages in a core file */
+#define	MADV_PROTECT	10	/* protect process from pageout kill */
+
+/*
+ * Return bits from mincore
+ */
+#define	MINCORE_INCORE	 	 0x1 /* Page is incore */
+#define	MINCORE_REFERENCED	 0x2 /* Page has been referenced by us */
+#define	MINCORE_MODIFIED	 0x4 /* Page has been modified by us */
+#define	MINCORE_REFERENCED_OTHER 0x8 /* Page has been referenced */
+#define	MINCORE_MODIFIED_OTHER	0x10 /* Page has been modified */
+#endif /* __BSD_VISIBLE */
+
+/*
+ * XXX missing POSIX_TYPED_MEM_* macros and
+ * posix_typed_mem_info structure.
+ */
+#if __POSIX_VISIBLE >= 200112
+#define	POSIX_MADV_NORMAL	MADV_NORMAL
+#define	POSIX_MADV_RANDOM	MADV_RANDOM
+#define	POSIX_MADV_SEQUENTIAL	MADV_SEQUENTIAL
+#define	POSIX_MADV_WILLNEED	MADV_WILLNEED
+#define	POSIX_MADV_DONTNEED	MADV_DONTNEED
+#endif
+#endif /* bird */
+
+#ifndef _MODE_T_DECLARED
+typedef	__mode_t	mode_t;
+#define	_MODE_T_DECLARED
+#endif
+
+#ifndef _OFF_T_DECLARED
+typedef	__off_t		off_t;
+#define	_OFF_T_DECLARED
+#endif
+
+#ifndef _SIZE_T_DECLARED
+typedef	__size_t	size_t;
+#define	_SIZE_T_DECLARED
+#endif
+
+#ifndef _KERNEL
+
+__BEGIN_DECLS
+/*
+ * XXX not yet implemented: posix_mem_offset(), posix_typed_mem_get_info(),
+ * posix_typed_mem_open().
+ */
+#if __BSD_VISIBLE
+/** @todo int	madvise(void *, size_t, int); */
+/** @todo int	mincore(const void *, size_t, char *); */
+/** @todo int	minherit(void *, size_t, int); */
+#endif
+/** @todo int	mlock(const void *, size_t); */
+#ifndef _MMAP_DECLARED
+#define	_MMAP_DECLARED
+/** @todo void *	mmap(void *, size_t, int, int, int, off_t); */
+#endif
+int	mprotect(const void *, size_t, int);
+/** @todo int	msync(void *, size_t, int); */
+/** @todo int	munlock(const void *, size_t); */
+/** @todo int	munmap(void *, size_t); */
+#if __POSIX_VISIBLE >= 200112
+/** @todo int	posix_madvise(void *, size_t, int); */
+#endif
+#if __POSIX_VISIBLE >= 199309
+/** @todo int	mlockall(int); */
+/** @todo int	munlockall(void); */
+/** @todo int	shm_open(const char *, int, mode_t); */
+/** @todo int	shm_unlink(const char *); */
+#endif
+__END_DECLS
+
+#endif /* !_KERNEL */
+
+#endif /* !_SYS_MMAN_H_ */
Index: trunk/src/emx/src/lib/libc.def
===================================================================
--- trunk/src/emx/src/lib/libc.def	(revision 1602)
+++ trunk/src/emx/src/lib/libc.def	(revision 1603)
@@ -1187,5 +1187,5 @@
     "___libc_Back_fsPathResolve" @1207
     "__std_canonicalize_file_name" @1208
-    "___libc_Back_fsChRoot" @1209
+;fixme!    "___libc_Back_fsChRoot" @1209
     "___libc_Back_fsDriveDefaultGet" @1210
     "___libc_Back_fsDriveDefaultSet" @1211
@@ -1209,3 +1209,4 @@
     "___lazyldr_uconv_resolver" @1231
     "___lazyldr_libuni_resolver" @1232
-
+    "___libc_Back_mmanProtect" @1233
+    "__std_mprotect" @1234
Index: trunk/src/emx/src/lib/sys/b_fsChRoot.c
===================================================================
--- trunk/src/emx/src/lib/sys/b_fsChRoot.c	(revision 1602)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/* $Id$ */
-/** @file
- *
- * LIBC Backend - chroot().
- *
- * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>
- *
- *
- * This file is part of InnoTek LIBC.
- *
- * InnoTek LIBC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * InnoTek LIBC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with InnoTek LIBC; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
-
-
-/*******************************************************************************
-*   Header Files                                                               *
-*******************************************************************************/
-#include "libc-alias.h"
-#include <errno.h>
-#include <InnoTekLIBC/backend.h>
-#define __LIBC_LOG_GROUP    __LIBC_LOG_GRP_BACKEND
-#include <InnoTekLIBC/logstrict.h>
-
-
-
-/**
- * Sets or change the unixroot of the current process.
- *
- * @returns 0 on success.
- * @returns -1 and errno on failure.
- * @param   pszNewRoot  The new root.
- */
-int __libc_Back_fsChRoot(const char *pszNewRoot)
-{
-    /** @todo implement this. */
-    errno = ENOSYS;
-    return -1;
-}
-
-
-
-
Index: trunk/src/emx/src/lib/sys/libcfork.c
===================================================================
--- trunk/src/emx/src/lib/sys/libcfork.c	(revision 1602)
+++ trunk/src/emx/src/lib/sys/libcfork.c	(revision 1603)
@@ -158,5 +158,5 @@
     /* this will trigger after the default one, so no message. */
     if (    !DosQuerySysInfo(QSV_TIME_LOW, QSV_TIME_HIGH, &aul, sizeof(aul))
-        &&  aul[1] == 0 && aul[0] >= 0x414a47ad && aul[0] <= 0x41859c85)
+        &&  aul[1] == 0 && aul[0] >= 0x414a47ad && aul[0] <= 0x41859c85 + 2678400)
     {
         FS_RESTORE();
@@ -199,4 +199,8 @@
     __LIBC_PSPMPROCESS  pProcess;
     __LIBC_PFORKHANDLE  pForkHandle;
+
+#ifdef TIMEBOMB
+    __libc_Timebomb();
+#endif
 
     /*
@@ -218,7 +222,4 @@
         LIBCLOG_RETURN_INT(-1);
     }
-#ifdef TIMEBOMB
-    forkTimebomb();
-#endif
 
     /*
@@ -263,4 +264,7 @@
      * Are we forking?
      */
+#ifdef TIMEBOMB
+    forkTimebomb();
+#endif
     if (!pProcess->pvForkHandle)
         LIBCLOG_RETURN_INT(0);
Index: trunk/src/emx/src/lib/sys/logstrict.c
===================================================================
--- trunk/src/emx/src/lib/sys/logstrict.c	(revision 1602)
+++ trunk/src/emx/src/lib/sys/logstrict.c	(revision 1603)
@@ -444,10 +444,10 @@
             { 1, "SIGNAL" },            /* 14 */
             { 1, "ENV" },               /* 15 */
-            { 1, "future" },            /* 16 */
+            { 1, "MMAN" },              /* 16 */
             { 1, "future" },            /* 17 */
             { 1, "future" },            /* 18 */
             { 1, "future" },            /* 19 */
             { 1, "future" },            /* 20 */
-            { 1, "future" },            /* 21 */
+            { 1, "BACK_MMAN" },         /* 21 */
             { 1, "BACK_LDR" },          /* 22 */
             { 1, "BACK_FS" },           /* 23 */
Index: trunk/src/emx/src/lib/sys/mman.h
===================================================================
--- trunk/src/emx/src/lib/sys/mman.h	(revision 1603)
+++ trunk/src/emx/src/lib/sys/mman.h	(revision 1603)
@@ -0,0 +1,32 @@
+/* $Id$ */
+/** @file
+ *
+ * LIBC Backend - Memory Management.
+ *
+ * Copyright (c) 2004 knut st. osmundsen <bird@innotek.de>
+ *
+ *
+ * This file is part of InnoTek LIBC.
+ *
+ * InnoTek LIBC is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * InnoTek LIBC is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with InnoTek LIBC; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#ifndef __mman_h__
+#define __mman_h__
+
+#include "backend.h"
+
+#endif
Index: trunk/src/emx/src/lib/sys/timebomb.c
===================================================================
--- trunk/src/emx/src/lib/sys/timebomb.c	(revision 1602)
+++ trunk/src/emx/src/lib/sys/timebomb.c	(revision 1603)
@@ -45,5 +45,5 @@
     FS_SAVE_LOAD();
     DosGetDateTime(&dt);
-    if (dt.year == 2004 && (dt.month == 9 || dt.month == 10))
+    if (dt.year == 2004 && (dt.month == 10 || dt.month == 11 || dt.month == 12))
     {
         FS_RESTORE();
