Index: branches/libc-0.6/src/emx/include/InnoTekLIBC/sharedpm.h
===================================================================
--- branches/libc-0.6/src/emx/include/InnoTekLIBC/sharedpm.h	(revision 2537)
+++ branches/libc-0.6/src/emx/include/InnoTekLIBC/sharedpm.h	(revision 2538)
@@ -278,5 +278,6 @@
 
 /**
- * SPM fs inherit data.
+ * The SPM fs inherit data, part 1.
+ * The FS data is stored in two sections for legacy reasons.
  */
 typedef struct __libc_SPMInhFS
@@ -291,4 +292,17 @@
 /** Pointer to FS inherit data. */
 typedef __LIBC_SPMINHFS *__LIBC_PSPMINHFS;
+
+/**
+ * SPM fs inherit data, part two.
+ */
+typedef struct __libc_SPMInhFS2
+{
+    /** The size of this structure. */
+    unsigned    cb;
+    /** The umask value. */
+    unsigned    fUMask;
+} __LIBC_SPMINHFS2;
+/** Pointer to FS inherit data, part two. */
+typedef __LIBC_SPMINHFS2 *__LIBC_PSPMINHFS2;
 
 /**
@@ -326,4 +340,6 @@
      * All the strings are NULL terminated and referenced by offset. */
     char                   *pszStrings;
+    /** More file system stuff. */
+    __LIBC_PSPMINHFS2       pFS2;
 } __LIBC_SPMINHERIT;
 /** Pointer to inherit data. */
Index: branches/libc-0.6/src/emx/src/lib/sys/__spawnve.c
===================================================================
--- branches/libc-0.6/src/emx/src/lib/sys/__spawnve.c	(revision 2537)
+++ branches/libc-0.6/src/emx/src/lib/sys/__spawnve.c	(revision 2538)
@@ -58,5 +58,7 @@
         size_t              cbFS;
         __LIBC_PSPMINHFS    pFS;
-        if (!__libc_back_fsInheritPack(&pFS, &cbFS))
+        size_t              cbFS2;
+        __LIBC_PSPMINHFS2   pFS2;
+        if (!__libc_back_fsInheritPack(&pFS, &cbFS, &pFS2, &cbFS2))
         {
             /*
@@ -95,4 +97,15 @@
                         pRet->pFS = NULL;
 
+                    /* fs2 */
+                    if (pFS2)
+                    {
+                        pRet->pFS2 = (__LIBC_PSPMINHFS)p;
+                        p += ALIGNIT(cbFS2);
+                        memcpy(pRet->pFS2, pFS2, cbFS2);
+                        free(pFS2);
+                    }
+                    else
+                        pRet->pFS2 = NULL;
+
                     /* sig */
                     if (pSig)
@@ -123,4 +136,5 @@
             }
             free(pFS);
+            free(pFS2);
         }
 
Index: branches/libc-0.6/src/emx/src/lib/sys/b_fs.h
===================================================================
--- branches/libc-0.6/src/emx/src/lib/sys/b_fs.h	(revision 2537)
+++ branches/libc-0.6/src/emx/src/lib/sys/b_fs.h	(revision 2538)
@@ -242,8 +242,10 @@
  * @returns 0 on success.
  * @returns -1 on failure.
- * @param   ppFS    Where to store the pointer to the inherit data.
- * @param   pcbFS   Where to store the size of the inherit data.
- */
-int __libc_back_fsInheritPack(__LIBC_PSPMINHFS *ppFS, size_t *pcbFS);
+ * @param   ppFS    Where to store the pointer to the inherit data, part 1.
+ * @param   pcbFS   Where to store the size of the inherit data, part 1.
+ * @param   ppFS2   Where to store the pointer to the inherit data, part 2.
+ * @param   pcbFS2  Where to store the size of the inherit data, part 2.
+ */
+int __libc_back_fsInheritPack(__LIBC_PSPMINHFS *ppFS, size_t *pcbFS, __LIBC_PSPMINHFS2 *ppFS2, size_t *pcbFS2);
 
 /**
Index: branches/libc-0.6/src/emx/src/lib/sys/fs.c
===================================================================
--- branches/libc-0.6/src/emx/src/lib/sys/fs.c	(revision 2537)
+++ branches/libc-0.6/src/emx/src/lib/sys/fs.c	(revision 2538)
@@ -250,4 +250,17 @@
      */
     __LIBC_PSPMINHERIT  pInherit = __libc_spmInheritRequest();
+
+    /* part 2, the umask. */
+    __LIBC_PSPMINHFS2   pFS2;
+    if (    pInherit
+        &&  pInherit->cb > offsetof(__LIBC_SPMINHERIT, pFS2)
+        &&  (pFS2 = pInherit->pFS2) != NULL
+        &&  !(pFS2->fUMask & ~0777))
+    {
+        LIBCLOG_MSG("Inherited fUMask=%04o\n", pFS2->fUMask);
+        __libc_gfsUMask = pFS2->fUMask & 0777;
+    }
+
+    /* part 1, the unixroot. */
     __LIBC_PSPMINHFS    pFS;
     if (    pInherit
@@ -339,13 +352,17 @@
  * @returns 0 on success.
  * @returns -1 on failure.
- * @param   ppFS    Where to store the pointer to the inherit data.
- * @param   pcbFS   Where to store the size of the inherit data.
- */
-int __libc_back_fsInheritPack(__LIBC_PSPMINHFS *ppFS, size_t *pcbFS)
-{
-    LIBCLOG_ENTER("ppFS=%p pcbFS=%p\n", (void *)ppFS, (void *)pcbFS);
+ * @param   ppFS    Where to store the pointer to the inherit data, part 1.
+ * @param   pcbFS   Where to store the size of the inherit data, part 1.
+ * @param   ppFS2   Where to store the pointer to the inherit data, part 2.
+ * @param   pcbFS2  Where to store the size of the inherit data, part 2.
+ */
+int __libc_back_fsInheritPack(__LIBC_PSPMINHFS *ppFS, size_t *pcbFS, __LIBC_PSPMINHFS2 *ppFS2, size_t *pcbFS2)
+{
+    LIBCLOG_ENTER("ppFS=%p pcbFS=%p ppFS2=%p pcbFS2=%p\n", (void *)ppFS, (void *)pcbFS, (void *)ppFS2, (void *)pcbFS2);
 
     *ppFS = NULL;
     *pcbFS = 0;
+    *ppFS2 = NULL;
+    *pcbFS2 = 0;
 
     if (__libc_back_fsMutexRequest())
@@ -366,4 +383,20 @@
             *pcbFS = cb;
             *ppFS = pFS;
+        }
+        else
+            rc = -1;
+    }
+
+    if (!rc)
+    {
+        __LIBC_PSPMINHFS2 pFS2 = (__LIBC_PSPMINHFS2)malloc(sizeof(*pFS2));
+        if (pFS2)
+        {
+            pFS2->cb = sizeof(*pFS2);
+            pFS2->fUMask = __libc_gfsUMask;
+            LIBCLOG_MSG("fUMask=%04o\n", pFS2->fUMask);
+
+            *pcbFS2 = sizeof(*pFS2);
+            *ppFS2 = pFS2;
         }
         else
