1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
14 /************************************************************************/
15 /*****************************PROCESS OPERATIONS*************************/
16 /************************************************************************/
18 typedef struct PRProcess PRProcess
;
19 typedef struct PRProcessAttr PRProcessAttr
;
21 NSPR_API(PRProcessAttr
*) PR_NewProcessAttr(void);
23 NSPR_API(void) PR_ResetProcessAttr(PRProcessAttr
*attr
);
25 NSPR_API(void) PR_DestroyProcessAttr(PRProcessAttr
*attr
);
27 NSPR_API(void) PR_ProcessAttrSetStdioRedirect(
30 PRFileDesc
*redirectFd
34 * OBSOLETE -- use PR_ProcessAttrSetStdioRedirect instead.
36 NSPR_API(void) PR_SetStdioRedirect(
39 PRFileDesc
*redirectFd
42 NSPR_API(PRStatus
) PR_ProcessAttrSetCurrentDirectory(
47 NSPR_API(PRStatus
) PR_ProcessAttrSetInheritableFD(
54 ** Create a new process
56 ** Create a new process executing the file specified as 'path' and with
57 ** the supplied arguments and environment.
59 ** This function may fail because of illegal access (permissions),
60 ** invalid arguments or insufficient resources.
62 ** A process may be created such that the creator can later synchronize its
63 ** termination using PR_WaitProcess().
66 NSPR_API(PRProcess
*) PR_CreateProcess(
70 const PRProcessAttr
*attr
);
72 NSPR_API(PRStatus
) PR_CreateProcessDetached(
76 const PRProcessAttr
*attr
);
78 NSPR_API(PRStatus
) PR_DetachProcess(PRProcess
*process
);
80 NSPR_API(PRStatus
) PR_WaitProcess(PRProcess
*process
, PRInt32
*exitCode
);
82 NSPR_API(PRStatus
) PR_KillProcess(PRProcess
*process
);
86 #endif /* prproces_h___ */