The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
UNIX domain sockets vs FIFOs mgessner UNIX for Advanced & Expert Users 2 03-27-2008 09:03 PM
tar and fifos Corona688 UNIX for Advanced & Expert Users 8 08-23-2006 07:21 PM
A little help understanding FIFOs? deckard Linux 0 11-01-2005 01:46 PM
forks, ipc, fifos, update issues... Funktar High Level Programming 6 10-02-2005 02:00 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-17-2005
Funktar Funktar is offline
Registered User
  
 

Join Date: May 2005
Posts: 6
Exclamation 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:
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:

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.
  #2 (permalink)  
Old 05-18-2005
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Moderators, are we allowed to help here?
  #3 (permalink)  
Old 05-18-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
I'll look the other way if you want to give some advice.
  #4 (permalink)  
Old 05-18-2005
Funktar Funktar is offline
Registered User
  
 

Join Date: May 2005
Posts: 6
i don't get it. what did i do?
  #5 (permalink)  
Old 05-18-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
I guess you missed:
(6) Do not post classroom or homework problems.
when you read our rules.
  #6 (permalink)  
Old 05-18-2005
Funktar Funktar is offline
Registered User
  
 

Join Date: May 2005
Posts: 6
well, you're right, sorry I missed it.
forget it then.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:41 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0