From owner-freebsd-questions Tue Jul 21 09:13:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA18471 for freebsd-questions-outgoing; Tue, 21 Jul 1998 09:13:33 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from mwunix.mitre.org (mwunix.mitre.org [128.29.154.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA18453 for ; Tue, 21 Jul 1998 09:13:24 -0700 (PDT) (envelope-from tqhoang@mitre.org) Received: from mitre.org (megatron.mitre.org [128.29.222.119]) by mwunix.mitre.org (8.8.8/8.8.8/mitre.0) with ESMTP id MAA10429; Tue, 21 Jul 1998 12:13:04 -0400 (EDT) Message-ID: <35B4BE3D.A723D9DB@mitre.org> Date: Tue, 21 Jul 1998 12:13:50 -0400 From: Tuan Hoang X-Mailer: Mozilla 4.05 [en] (WinNT; I) MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG CC: tqhoang@mitre.org Subject: no data in named pipes (FIFO's) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I'm having a problem with my named pipes (FIFO's). I have 2 processes communicating back and forth via 2 FIFO's. I create them successfully on the command line using: mkfifo fifo_to_simcon fifo_from_simcon I tested them using "cat" and "more" on the command line and they work as I expect them to (blocking, etc). In my program I open the FIFO's in the correct order. The problem is that when I write to the file descriptors, the return values are the size of the data that I wrote so it was successful but no data ever gets written to the FIFO's. An example of how I know this is that one program continuously writes data to the fifo_from_simcon and the other one takes its time reading the fifo_from_simcon so the data queues up. I know that the programs are logically correct because the same exact code runs fine under Slackware Linux 2.0.34 and Solaris x86 2.6. I'm using FreeBSD 2.2.6R from Walnut Creek. Here's what the FIFO's permissions look like and a sample of the open() calls: (Incidently, both programs reside in the same directory) prwxr-xr-x 1 tuan users 0 Jul 21 10:36 fifo_from_simcon| prwxr-xr-x 1 tuan users 0 Jul 21 10:35 fifo_to_simcon| In program 1: ReadFifoFd = open("./fifo_from_simcon", O_RDONLY, 0); WriteFifoFd = open("./fifo_to_simcon", O_WRONLY|O_TRUNC, 0); In program 2: WriteFifoFd = open("./fifo_from_simcon", O_WRONLY|O_TRUNC, 0); ReadFifoFd = open("./fifo_to_simcon", O_RDONLY, 0); Thanks, Tuan -- Tuan Hoang The MITRE Corporation Email: tqhoang@mitre.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message