I want to pass the display of the execution of the system () function in a fifo to be able to display it on another terminal, I tried a but it gives me a segmentation fault
void executeFile(char* sourcefname,struct Info_FIFO_Transaction donnees){
char *nomFichier, *sp;
char command[100];
int client_fifo_fd;
char client_fifo[400];
sprintf(client_fifo, CLIENT_FIFO_NAME, donnees.pid_client);
client_fifo_fd = open(client_fifo, O_WRONLY);
nomFichier = strtok_r(sourcefname, ".", &sp);
sprintf(command,"gcc -o fichCVSEXE%s %s.c\n",nomFichier,nomFichier);
// execution of file
strcat(donnees.transaction ,system(command));
if(client_fifo_fd!=-1){
write(client_fifo_fd, &donnees, sizeof(donnees));
close(client_fifo_fd);}
}