omg i need help so bad. I've been working on a school project for what seems like an eternity and i'm close to deadline. Using FIFO's (i ahve to) to communicate between parent and child proc's. Right now I'm stuck on a read/write.
fifomsg is a struct with int length and char[16] message fields. This is what I'm trying to send between the processes.
child code:
fdw = Open("syscallfifo", O_WRONLY);
fifomsg msg1;
strcpy(msg1.message, (char*)pid);
msg1.length = sizeof(msg1);
write(fdw, &msg1, sizeof(msg1));
close(fdw);
parent code:
fdr = Open("syscallfifo", O_RDWR);
fifomsg msg1;
read(fdr, &msg1.length, sizeof(msg1.length));
read(fdr, &msg1.message, sizeof(msg1) - sizeof(msg1.length));
close(fdr);
At this point in execution, the process halts and I have to suspend/kill. I'm begging for help. As soon as possible would be ideal.
Thank anyone for any consideration.
edit: wanted to mention I manaully browsed through the last 5 or 6 months of posts trying to find a similar situation and couldn't.