25 #include "pips_config.h"
54 #include <sys/types.h>
66 #define SIGNAL_TAG "# jpips send signal to tpips "
70 #define CHECKPOINT "CHECKPOINT"
71 #define INTERRUPT "INTERRUPT"
72 #define KILLNOW "EXIT"
73 #define ABORTIT "ABORT"
75 #define WRAPPER "[tpips_wrapper] "
77 #define starts_with(s1, s2) (strncmp(s1, s2, strlen(s2))==0)
116 #define tpw_check(what, comment) \
117 tpw_log(comment), tpw_check_perror(what, comment)
118 #define KILL(pid,sig) if (pid!=0) { tpw_check(kill(pid,sig),"kill()"); }
211 tpw_check(dup2(filedes[0], 0),
"dup2()");
226 fprintf(stderr,
WRAPPER "started, tpips pid is %d\n", (
int) process);
230 tpw_log(
"tpw_fork_inout() done");
243 while (c !=
'\n' && i<
SIZE-1 && (c = getc(in))!=EOF)
246 if (i==0)
return NULL;
319 fputs(
"exit\n", stdout);
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
void const char const char const int
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
static int line
FLEX_SCANNER.
static char * tpw_read_line(FILE *in)
static void tpw_fatal_error(char *message)
static void tpw_sig_handler(int sn)
signal handler for tpips_wrapper.
#define starts_with(s1, s2)
static void tpw_set_sig_handlers(void)
special handlers for tpips wrapper.
static void tpw_log(__attribute__((__unused__)) char *message)
Enable log with -DLOG for debug.
void tpips_wrapper(void)
fork a tpips to goes on, while the current process acts as a wrapper, which forwards orders,...
#define SIZE
UNIX headers.
static pid_t tpw_fork_inout(void)
fork, with stdout-stdin link kept
static void tpw_check_perror(int en, char *message)
checks returned value for most system commands (-1 and errno set).
static FILE * out_to_tpips
void(* sig_handler_t)(int)
static void tpw_send_string_to_tpips(char *line)
send line to tpips.
#define tpw_check(what, comment)
#define CHECKPOINT
available tags
static FILE * in_from_wrapper
static pid_t tpips_pid
global because needed in tpw_fatal_error.