Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_gfork.h
1 #if !defined(GLOBUS_GFORK_H)
2 #define GLOBUS_GFORK_H 1
3 
4 #include "globus_common.h"
5 #include "globus_xio.h"
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
11 #ifdef __GNUC__
12 #define GlobusGForkFuncName(func) static const char * _gfork_func_name __attribute__((__unused__)) = #func
13 #else
14 #define GlobusGForkFuncName(func) static const char * _gfork_func_name = #func
15 #endif
16 
17 #define GFORK_CHILD_READ_ENV "GFORK_CHILD_READ_ENV"
18 #define GFORK_CHILD_WRITE_ENV "GFORK_CHILD_WRITE_ENV"
19 #define GFORK_CHILD_CS_ENV "GFORK_CHILD_CS_ENV"
20 #define GFORK_CHILD_INSTANCE_ENV "GFORK_CHILD_INSTANCE_ENV"
21 
22 typedef void * gfork_child_handle_t;
23 
24 typedef enum
25 {
26  GLOBUS_GFORK_DEBUG_ERROR = 1,
27  GLOBUS_GFORK_DEBUG_WARNING = 2,
28  GLOBUS_GFORK_DEBUG_TRACE = 4,
29  GLOBUS_GFORK_DEBUG_INTERNAL_TRACE = 8,
30  GLOBUS_GFORK_DEBUG_INFO = 16,
31  GLOBUS_GFORK_DEBUG_STATE = 32,
32  GLOBUS_GFORK_DEBUG_INFO_VERBOSE = 64
33 } globus_gfork_debug_levels_t;
34 
35 /*
36  * server plug in functions
37  */
38 
39 /* when a connection is accepted */
40 typedef void
41 (*globus_gfork_open_func_t)(
42  gfork_child_handle_t handle,
43  void * user_arg,
44  pid_t from_pid);
45 
46 /* connection cloesd */
47 typedef void
48 (*globus_gfork_closed_func_t)(
49  gfork_child_handle_t handle,
50  void * user_arg,
51  pid_t from_pid);
52 
53 typedef void
54 (*globus_gfork_error_func_t)(
55  gfork_child_handle_t handle,
56  void * user_arg,
57  globus_result_t result);
58 
59 
60 typedef void
61 (*globus_gfork_incoming_cb_t)(
62  gfork_child_handle_t handle,
63  void * user_arg,
64  pid_t from_pid,
65  globus_byte_t * buffer,
66  globus_size_t len);
67 
68 
69 /*
70  * client functions
71  */
73 globus_gfork_child_worker_start(
74  gfork_child_handle_t * out_handle,
75  const char * in_env_suffix,
76  globus_gfork_closed_func_t close_cb,
77  globus_gfork_incoming_cb_t incoming_cb,
78  globus_gfork_error_func_t error_cb,
79  void * user_arg);
80 
82 globus_gfork_child_master_start(
83  gfork_child_handle_t * out_handle,
84  const char * in_env_suffix,
85  globus_gfork_open_func_t open_cb,
86  globus_gfork_closed_func_t close_cb,
87  globus_gfork_incoming_cb_t incoming_cb,
88  globus_gfork_error_func_t error_cb,
89  void * user_arg);
90 
92 globus_gfork_broadcast(
93  gfork_child_handle_t handle,
94  globus_xio_iovec_t * iov,
95  int iovc,
97  void * user_arg);
98 
100 globus_gfork_send(
101  gfork_child_handle_t handle,
102  uid_t pid,
103  globus_xio_iovec_t * iov,
104  int iovc,
106  void * user_arg);
107 
109 globus_gfork_child_stop(
110  gfork_child_handle_t in_handle);
111 
112 extern globus_module_descriptor_t globus_i_gfork_parent_module;
113 #define GLOBUS_GFORK_PARENT_MODULE (&globus_i_gfork_parent_module)
114 extern globus_module_descriptor_t globus_i_gfork_child_module;
115 #define GLOBUS_GFORK_CHILD_MODULE (&globus_i_gfork_child_module)
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 #endif /* GLOBUS_GFORK_H */
size_t globus_size_t
Standard size of memory objectThe globus_size_t is the size of a memory object. It is identical to si...
Definition: globus_types.h:48
unsigned char globus_byte_t
Unsigned byte datatypeThis is used for byte-addressable arrays of arbitrary data which is not subject...
Definition: globus_types.h:85
Headers common to all of Globus.
uint32_t globus_result_t
Definition: globus_types.h:99
void(* globus_xio_iovec_callback_t)(globus_xio_handle_t handle, globus_result_t result, globus_xio_iovec_t *iovec, int count, globus_size_t nbytes, globus_xio_data_descriptor_t data_desc, void *user_arg)
Definition: globus_xio.h:619
Module Descriptor.
Definition: globus_module.h:71