Changeset 2538
- Timestamp:
- Feb 6, 2006, 11:12:16 PM (20 years ago)
- Location:
- branches/libc-0.6/src/emx
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/include/InnoTekLIBC/sharedpm.h
r2323 r2538 278 278 279 279 /** 280 * SPM fs inherit data. 280 * The SPM fs inherit data, part 1. 281 * The FS data is stored in two sections for legacy reasons. 281 282 */ 282 283 typedef struct __libc_SPMInhFS … … 291 292 /** Pointer to FS inherit data. */ 292 293 typedef __LIBC_SPMINHFS *__LIBC_PSPMINHFS; 294 295 /** 296 * SPM fs inherit data, part two. 297 */ 298 typedef struct __libc_SPMInhFS2 299 { 300 /** The size of this structure. */ 301 unsigned cb; 302 /** The umask value. */ 303 unsigned fUMask; 304 } __LIBC_SPMINHFS2; 305 /** Pointer to FS inherit data, part two. */ 306 typedef __LIBC_SPMINHFS2 *__LIBC_PSPMINHFS2; 293 307 294 308 /** … … 326 340 * All the strings are NULL terminated and referenced by offset. */ 327 341 char *pszStrings; 342 /** More file system stuff. */ 343 __LIBC_PSPMINHFS2 pFS2; 328 344 } __LIBC_SPMINHERIT; 329 345 /** Pointer to inherit data. */ -
branches/libc-0.6/src/emx/src/lib/sys/__spawnve.c
r2323 r2538 58 58 size_t cbFS; 59 59 __LIBC_PSPMINHFS pFS; 60 if (!__libc_back_fsInheritPack(&pFS, &cbFS)) 60 size_t cbFS2; 61 __LIBC_PSPMINHFS2 pFS2; 62 if (!__libc_back_fsInheritPack(&pFS, &cbFS, &pFS2, &cbFS2)) 61 63 { 62 64 /* … … 95 97 pRet->pFS = NULL; 96 98 99 /* fs2 */ 100 if (pFS2) 101 { 102 pRet->pFS2 = (__LIBC_PSPMINHFS)p; 103 p += ALIGNIT(cbFS2); 104 memcpy(pRet->pFS2, pFS2, cbFS2); 105 free(pFS2); 106 } 107 else 108 pRet->pFS2 = NULL; 109 97 110 /* sig */ 98 111 if (pSig) … … 123 136 } 124 137 free(pFS); 138 free(pFS2); 125 139 } 126 140 -
branches/libc-0.6/src/emx/src/lib/sys/b_fs.h
r2525 r2538 242 242 * @returns 0 on success. 243 243 * @returns -1 on failure. 244 * @param ppFS Where to store the pointer to the inherit data. 245 * @param pcbFS Where to store the size of the inherit data. 246 */ 247 int __libc_back_fsInheritPack(__LIBC_PSPMINHFS *ppFS, size_t *pcbFS); 244 * @param ppFS Where to store the pointer to the inherit data, part 1. 245 * @param pcbFS Where to store the size of the inherit data, part 1. 246 * @param ppFS2 Where to store the pointer to the inherit data, part 2. 247 * @param pcbFS2 Where to store the size of the inherit data, part 2. 248 */ 249 int __libc_back_fsInheritPack(__LIBC_PSPMINHFS *ppFS, size_t *pcbFS, __LIBC_PSPMINHFS2 *ppFS2, size_t *pcbFS2); 248 250 249 251 /** -
branches/libc-0.6/src/emx/src/lib/sys/fs.c
r2530 r2538 250 250 */ 251 251 __LIBC_PSPMINHERIT pInherit = __libc_spmInheritRequest(); 252 253 /* part 2, the umask. */ 254 __LIBC_PSPMINHFS2 pFS2; 255 if ( pInherit 256 && pInherit->cb > offsetof(__LIBC_SPMINHERIT, pFS2) 257 && (pFS2 = pInherit->pFS2) != NULL 258 && !(pFS2->fUMask & ~0777)) 259 { 260 LIBCLOG_MSG("Inherited fUMask=%04o\n", pFS2->fUMask); 261 __libc_gfsUMask = pFS2->fUMask & 0777; 262 } 263 264 /* part 1, the unixroot. */ 252 265 __LIBC_PSPMINHFS pFS; 253 266 if ( pInherit … … 339 352 * @returns 0 on success. 340 353 * @returns -1 on failure. 341 * @param ppFS Where to store the pointer to the inherit data. 342 * @param pcbFS Where to store the size of the inherit data. 343 */ 344 int __libc_back_fsInheritPack(__LIBC_PSPMINHFS *ppFS, size_t *pcbFS) 345 { 346 LIBCLOG_ENTER("ppFS=%p pcbFS=%p\n", (void *)ppFS, (void *)pcbFS); 354 * @param ppFS Where to store the pointer to the inherit data, part 1. 355 * @param pcbFS Where to store the size of the inherit data, part 1. 356 * @param ppFS2 Where to store the pointer to the inherit data, part 2. 357 * @param pcbFS2 Where to store the size of the inherit data, part 2. 358 */ 359 int __libc_back_fsInheritPack(__LIBC_PSPMINHFS *ppFS, size_t *pcbFS, __LIBC_PSPMINHFS2 *ppFS2, size_t *pcbFS2) 360 { 361 LIBCLOG_ENTER("ppFS=%p pcbFS=%p ppFS2=%p pcbFS2=%p\n", (void *)ppFS, (void *)pcbFS, (void *)ppFS2, (void *)pcbFS2); 347 362 348 363 *ppFS = NULL; 349 364 *pcbFS = 0; 365 *ppFS2 = NULL; 366 *pcbFS2 = 0; 350 367 351 368 if (__libc_back_fsMutexRequest()) … … 366 383 *pcbFS = cb; 367 384 *ppFS = pFS; 385 } 386 else 387 rc = -1; 388 } 389 390 if (!rc) 391 { 392 __LIBC_PSPMINHFS2 pFS2 = (__LIBC_PSPMINHFS2)malloc(sizeof(*pFS2)); 393 if (pFS2) 394 { 395 pFS2->cb = sizeof(*pFS2); 396 pFS2->fUMask = __libc_gfsUMask; 397 LIBCLOG_MSG("fUMask=%04o\n", pFS2->fUMask); 398 399 *pcbFS2 = sizeof(*pFS2); 400 *ppFS2 = pFS2; 368 401 } 369 402 else
Note:
See TracChangeset
for help on using the changeset viewer.