![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| will a named pipe always be size 0 on filesystem? | JamesByars | UNIX for Advanced & Expert Users | 4 | 03-01-2008 01:39 PM |
| fifo or named pipe working? | lvkchaitanya | UNIX for Dummies Questions & Answers | 1 | 02-06-2008 09:44 AM |
| Named Pipe contents to a file | carl_vieyra | UNIX for Dummies Questions & Answers | 4 | 02-26-2007 09:33 PM |
| Named PIPE | Tamil | UNIX for Dummies Questions & Answers | 2 | 01-17-2007 12:20 AM |
| IPC using named pipe | sharanbr | UNIX for Advanced & Expert Users | 1 | 02-15-2006 01:24 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
IPC using named pipe
Hi All,
I am facing a vague issue while trying to make two process talk to each other using named pipe. read process ========= The process which reads, basically creates FIFO using mkfifo - ret_val = mkfifo(HALF_DUPLEX, 0666) func. It then opens the pipe using open func - fd = open (HALF_DUPLEX,O_RDONLY); After this read function is called - numread = read(fd, test_data, MAX_BUF_SIZE); Write process ========== This opens pipe fd = open(HALF_DUPLEX, O_WRONLY); Then write is done to the pipe - write (fd, 1, 1); I am finding that even though i am writing a value of 1, it gets reflected as 255 by read process. One thing I noticed is that the file descriptor returned for read process and write process are both different as can be seen by the program output below read process - @ 0 NS Created pipe successfully fd = 6 read process - Read fd = 6 write process - Opened pipe for writing only .. fd = 3 write process - New request with data rqst = 1 fd = 3 read process - Received data from test .. ff Could you please help .. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
cut the code too a minimum and post.
have you tried cat'ing the fifo while the writer is working? or echo'ing to it while the reader runs? |
|
#3
|
||||
|
||||
|
write (fd, 1, 1)
You might want to review the man page on "write". |
||||
| Google The UNIX and Linux Forums |