Praying for help: FIFOs, IPC

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.

Moderators, are we allowed to help here?

I'll look the other way if you want to give some advice. :slight_smile:

i don't get it. what did i do?

I guess you missed:
(6) Do not post classroom or homework problems.
when you read our rules. :stuck_out_tongue:

well, you're right, sorry I missed it.
forget it then.