1 /*
2 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2005 The University of Tennessee and The University
6 * of Tennessee Research Foundation. All rights
7 * reserved.
8 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9 * University of Stuttgart. All rights reserved.
10 * Copyright (c) 2004-2005 The Regents of the University of California.
11 * All rights reserved.
12 * Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
13 * Copyright (c) 2016-2017 Intel, Inc. All rights reserved.
14 * $COPYRIGHT$
15 *
16 * Additional copyrights may follow
17 *
18 * $HEADER$
19 *
20 */
21
22 #ifndef IOF_BASE_SETUP_H_
23 #define IOF_BASE_SETUP_H_
24
25 #include "orte_config.h"
26 #include "orte/types.h"
27
28 #include "orte/mca/iof/base/base.h"
29
30 struct orte_iof_base_io_conf_t {
31 int usepty;
32 bool connect_stdin;
33
34 /* private - callers should not modify these fields */
35 int p_stdin[2];
36 int p_stdout[2];
37 int p_stderr[2];
38 #if OPAL_PMIX_V1
39 int p_internal[2];
40 #endif
41 };
42 typedef struct orte_iof_base_io_conf_t orte_iof_base_io_conf_t;
43
44
45 /**
46 * Do pre-fork IOF setup tasks
47 *
48 * Do all stdio forwarding that must be done before fork() is called.
49 * This might include creating pipes or ptys or similar work.
50 */
51 ORTE_DECLSPEC int orte_iof_base_setup_prefork(orte_iof_base_io_conf_t *opts);
52
53 ORTE_DECLSPEC int orte_iof_base_setup_child(orte_iof_base_io_conf_t *opts,
54 char ***env);
55
56 ORTE_DECLSPEC int orte_iof_base_setup_parent(const orte_process_name_t* name,
57 orte_iof_base_io_conf_t *opts);
58
59 /* setup output files */
60 ORTE_DECLSPEC int orte_iof_base_setup_output_files(const orte_process_name_t* dst_name,
61 orte_job_t *jobdat,
62 orte_iof_proc_t *proct);
63
64 #endif