Ana
Ana
h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
//Null-terminate buffer
buffer[bytes_read] = '\0';
printf(buffer);
int i = 1;
while(i < argc){
if(strcmp(argv[i], "-s") == 0){
i++;
if(strcmp(fifo_name, "") == 0){
perror("No fifo_name");
return -1;
}
strcpy(message, argv[i]);
snd(fifo_name, message);
}
else if(strcmp(argv[i], "-r") == 0){
if(strcmp(fifo_name, "") == 0){
perror("No fifo_name");
return -1;
}
rcv(fifo_name);
}
i++;
}
}