+typedef struct s_smx_ctx_sysv {
+ s_smx_ctx_base_t super; /* Fields of super implementation */
+ ucontext_t uc; /* the ucontext that executes the code */
+#ifdef HAVE_VALGRIND_VALGRIND_H
+ unsigned int valgrind_stack_id; /* the valgrind stack id */
+#endif
+ char stack[0]; /* the thread stack (must remain the last element of the structure) */
+} s_smx_ctx_sysv_t, *smx_ctx_sysv_t;
+
+#ifdef CONTEXT_THREADS
+static xbt_parmap_t sysv_parmap;
+static ucontext_t* sysv_workers_stacks; /* space to save the worker's stack in each thread */
+static unsigned long sysv_threads_working; /* number of threads that have started their work */
+static xbt_os_thread_key_t sysv_worker_id_key; /* thread-specific storage for the thread id */
+#endif
+static unsigned long sysv_process_index = 0; /* index of the next process to run in the
+ * list of runnable processes */
+static smx_ctx_sysv_t sysv_maestro_context;
+
+static int smx_ctx_sysv_factory_finalize(smx_context_factory_t *factory);
+static smx_context_t
+smx_ctx_sysv_create_context_sized(size_t structure_size,
+ xbt_main_func_t code, int argc,
+ char **argv,
+ void_pfn_smxprocess_t cleanup_func,
+ void *data);
+static void smx_ctx_sysv_free(smx_context_t context);