#include #include #include #include #include #define FIFO_IN "fifo.c2s." #define FIFO_OUT "fifo.s2c." int main(int argc, char ** argv) { int client_id; char fifo_in1[20]; char fifo_out1[20]; FILE* read1; FILE* write1; int readfd1; int writefd1; client_id = 1; sprintf(fifo_in1, "%s%d", FIFO_IN, client_id); sprintf(fifo_out1, "%s%d", FIFO_OUT, client_id); printf("Output fifo: |%s|\n", fifo_out1); write1 = fopen(fifo_out1, "w"); if (write1 == NULL) { fprintf(stderr, "%s: open of %s\n", strerror(errno), fifo_out1); exit(1); } fprintf(stderr, "Input fifo: |%s|\n", fifo_in1); read1 = fopen(fifo_in1, "r"); if (readfd1 == -1) { fprintf(stderr, "%s: open of %s\n", strerror(errno), fifo_in1); exit(1); } exit(0); }