Changeset 101839 in vbox for trunk/src/libs/xpcom18a4/nsprpub/pr
- Timestamp:
- Nov 5, 2023 5:11:43 PM (15 months ago)
- Location:
- trunk/src/libs/xpcom18a4/nsprpub/pr
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/primpl.h
r101813 r101839 623 623 /* Process control */ 624 624 625 extern PRProcess * _PR_MD_CREATE_PROCESS(626 const char *path,627 char *const *argv,628 char *const *envp,629 const PRProcessAttr *attr);630 #define _PR_MD_CREATE_PROCESS _MD_CREATE_PROCESS631 632 625 #ifdef _MD_CREATE_PROCESS_DETACHED 633 626 # define _PR_MD_CREATE_PROCESS_DETACHED _MD_CREATE_PROCESS_DETACHED 634 627 #endif 635 636 extern PRStatus _PR_MD_DETACH_PROCESS(PRProcess *process);637 #define _PR_MD_DETACH_PROCESS _MD_DETACH_PROCESS638 639 extern PRStatus _PR_MD_WAIT_PROCESS(PRProcess *process, PRInt32 *exitCode);640 #define _PR_MD_WAIT_PROCESS _MD_WAIT_PROCESS641 642 extern PRStatus _PR_MD_KILL_PROCESS(PRProcess *process);643 #define _PR_MD_KILL_PROCESS _MD_KILL_PROCESS644 628 645 629 /* Current Time */ -
trunk/src/libs/xpcom18a4/nsprpub/pr/include/prproces.h
r11551 r101839 49 49 #define PR_ResetProcessAttr VBoxNsprPR_ResetProcessAttr 50 50 #define PR_ProcessAttrSetStdioRedirect VBoxNsprPR_ProcessAttrSetStdioRedirect 51 #define PR_SetStdioRedirect VBoxNsprPR_SetStdioRedirect52 51 #define PR_ProcessAttrSetCurrentDirectory VBoxNsprPR_ProcessAttrSetCurrentDirectory 53 #define PR_CreateProcess VBoxNsprPR_CreateProcess54 #define PR_DetachProcess VBoxNsprPR_DetachProcess55 #define PR_WaitProcess VBoxNsprPR_WaitProcess56 #define PR_KillProcess VBoxNsprPR_KillProcess57 52 #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */ 58 53 … … 78 73 ); 79 74 80 /*81 * OBSOLETE -- use PR_ProcessAttrSetStdioRedirect instead.82 */83 NSPR_API(void) PR_SetStdioRedirect(84 PRProcessAttr *attr,85 PRSpecialFD stdioFd,86 PRFileDesc *redirectFd87 );88 89 75 NSPR_API(PRStatus) PR_ProcessAttrSetCurrentDirectory( 90 76 PRProcessAttr *attr, … … 98 84 ); 99 85 100 /*101 ** Create a new process102 **103 ** Create a new process executing the file specified as 'path' and with104 ** the supplied arguments and environment.105 **106 ** This function may fail because of illegal access (permissions),107 ** invalid arguments or insufficient resources.108 **109 ** A process may be created such that the creator can later synchronize its110 ** termination using PR_WaitProcess().111 */112 113 NSPR_API(PRProcess*) PR_CreateProcess(114 const char *path,115 char *const *argv,116 char *const *envp,117 const PRProcessAttr *attr);118 119 86 NSPR_API(PRStatus) PR_CreateProcessDetached( 120 87 const char *path, … … 123 90 const PRProcessAttr *attr); 124 91 125 NSPR_API(PRStatus) PR_DetachProcess(PRProcess *process);126 127 NSPR_API(PRStatus) PR_WaitProcess(PRProcess *process, PRInt32 *exitCode);128 129 NSPR_API(PRStatus) PR_KillProcess(PRProcess *process);130 131 92 PR_END_EXTERN_C 132 93 -
trunk/src/libs/xpcom18a4/nsprpub/pr/src/md/unix/unix.c
r101812 r101839 1139 1139 } 1140 1140 1141 #if defined(LINUX)1142 extern void _MD_unix_terminate_waitpid_daemon(void);1143 1144 void _MD_CleanupBeforeExit(void)1145 {1146 _MD_unix_terminate_waitpid_daemon();1147 }1148 #endif1149 1150 1141 #if defined(SOLARIS) 1151 1142 PRIntervalTime _MD_Solaris_TicksPerSecond(void) -
trunk/src/libs/xpcom18a4/nsprpub/pr/src/misc/prinit.c
r101805 r101839 41 41 #ifdef VBOX_USE_IPRT_IN_NSPR 42 42 # include <iprt/initterm.h> 43 #endif 44 45 #ifdef VBOX 46 #include <iprt/err.h> 47 #include <iprt/env.h> 48 #include <iprt/file.h> 49 #include <iprt/process.h> 43 50 #endif 44 51 … … 287 294 PR_ASSERT(0); 288 295 } 289 }290 291 /*292 * OBSOLETE293 */294 PR_IMPLEMENT(void)295 PR_SetStdioRedirect(296 PRProcessAttr *attr,297 PRSpecialFD stdioFd,298 PRFileDesc *redirectFd)299 {300 #if defined(DEBUG)301 static PRBool warn = PR_TRUE;302 if (warn) {303 warn = _PR_Obsolete("PR_SetStdioRedirect()",304 "PR_ProcessAttrSetStdioRedirect()");305 }306 #endif307 PR_ProcessAttrSetStdioRedirect(attr, stdioFd, redirectFd);308 296 } 309 297 … … 470 458 } 471 459 472 PR_IMPLEMENT(PRProcess*) PR_CreateProcess(473 const char *path,474 char *const *argv,475 char *const *envp,476 const PRProcessAttr *attr)477 {478 return _PR_MD_CREATE_PROCESS(path, argv, envp, attr);479 } /* PR_CreateProcess */480 481 460 PR_IMPLEMENT(PRStatus) PR_CreateProcessDetached( 482 461 const char *path, … … 485 464 const PRProcessAttr *attr) 486 465 { 487 #ifndef _PR_MD_CREATE_PROCESS_DETACHED 488 PRProcess *process; 489 PRStatus rv; 490 s 491 #ifdef XP_OS2 492 process = _PR_CreateOS2ProcessEx(path, argv, envp, attr, PR_TRUE); 493 #else 494 process = PR_CreateProcess(path, argv, envp, attr); 495 #endif 496 if (NULL == process) { 466 int vrc; 467 int nEnv, idx; 468 RTENV childEnv; 469 RTENV newEnv = RTENV_DEFAULT; 470 471 /* this code doesn't support all attributes */ 472 PR_ASSERT(!attr || !attr->currentDirectory); 473 /* no custom environment, please */ 474 PR_ASSERT(!envp); 475 476 childEnv = RTENV_DEFAULT; 477 if (attr && attr->fdInheritBuffer) { 478 vrc = RTEnvClone(&newEnv, childEnv); 479 if (RT_FAILURE(vrc)) 480 return PR_FAILURE; 481 vrc = RTEnvPutEx(newEnv, attr->fdInheritBuffer); 482 if (RT_FAILURE(vrc)) 483 { 484 RTEnvDestroy(newEnv); 485 return PR_FAILURE; 486 } 487 childEnv = newEnv; 488 } 489 490 PRTHANDLE pStdIn = NULL, pStdOut = NULL, pStdErr = NULL; 491 RTHANDLE hStdIn, hStdOut, hStdErr; 492 if (attr && attr->stdinFd) 493 { 494 hStdIn.enmType = RTHANDLETYPE_FILE; 495 RTFileFromNative(&hStdIn.u.hFile, attr->stdinFd->secret->md.osfd); 496 pStdIn = &hStdIn; 497 } 498 if (attr && attr->stdoutFd) 499 { 500 hStdOut.enmType = RTHANDLETYPE_FILE; 501 RTFileFromNative(&hStdOut.u.hFile, attr->stdoutFd->secret->md.osfd); 502 pStdOut = &hStdOut; 503 } 504 if (attr && attr->stderrFd) 505 { 506 hStdErr.enmType = RTHANDLETYPE_FILE; 507 RTFileFromNative(&hStdErr.u.hFile, attr->stderrFd->secret->md.osfd); 508 pStdErr = &hStdErr; 509 } 510 511 vrc = RTProcCreateEx(path, (const char **)argv, childEnv, 512 RTPROC_FLAGS_DETACHED, pStdIn, pStdOut, pStdErr, 513 NULL /* pszAsUser */, NULL /* pszPassword */, NULL /* pExtraData */, 514 NULL /* phProcess */); 515 if (newEnv != RTENV_DEFAULT) { 516 RTEnvDestroy(newEnv); 517 } 518 if (RT_SUCCESS(vrc)) 519 return PR_SUCCESS; 520 else 497 521 return PR_FAILURE; 498 }499 rv = PR_DetachProcess(process);500 PR_ASSERT(PR_SUCCESS == rv);501 if (rv == PR_FAILURE) {502 PR_DELETE(process);503 return PR_FAILURE;504 }505 return PR_SUCCESS;506 #else /* _PR_MD_CREATE_PROCESS_DETACHED */507 return _PR_MD_CREATE_PROCESS_DETACHED(path, argv, envp, attr);508 #endif /* _PR_MD_CREATE_PROCESS_DETACHED */509 }510 511 PR_IMPLEMENT(PRStatus) PR_DetachProcess(PRProcess *process)512 {513 return _PR_MD_DETACH_PROCESS(process);514 }515 516 PR_IMPLEMENT(PRStatus) PR_WaitProcess(PRProcess *process, PRInt32 *exitCode)517 {518 return _PR_MD_WAIT_PROCESS(process, exitCode);519 } /* PR_WaitProcess */520 521 PR_IMPLEMENT(PRStatus) PR_KillProcess(PRProcess *process)522 {523 return _PR_MD_KILL_PROCESS(process);524 522 } 525 523
Note:
See TracChangeset
for help on using the changeset viewer.