1 /* Copyright (c) 2015. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #ifndef SIMGRID_MC_SERVER_H
8 #define SIMGRID_MC_SERVER_H
15 #include <sys/signalfd.h>
16 #include <sys/types.h>
20 #include "mc_process.h"
25 #define MC_SERVER_ERROR SIMGRID_ERROR
27 typedef struct s_mc_server s_mc_server_t, *mc_server_t;
29 extern mc_server_t mc_server;
31 XBT_INTERNAL void MC_server_wait_client(simgrid::mc::Process* process);
32 XBT_INTERNAL void MC_server_simcall_handle(simgrid::mc::Process* process, unsigned long pid, int value);
34 XBT_INTERNAL void MC_server_loop(mc_server_t server);
46 s_mc_server(pid_t pid, int socket);
50 void resume(simgrid::mc::Process* process);
54 void handle_signals();
55 void handle_waitpid();
56 void on_signal(const struct signalfd_siginfo* info);