From owner-freebsd-questions Tue Jul 6 1:17:36 1999 Delivered-To: freebsd-questions@freebsd.org Received: from leonis.nus.edu.sg (leonis.nus.edu.sg [137.132.1.18]) by hub.freebsd.org (Postfix) with ESMTP id 9A97C14E78 for ; Tue, 6 Jul 1999 01:17:31 -0700 (PDT) (envelope-from thgoh@singapore.com) Received: from singapore.com (dial62-172.dialup.nus.edu.sg [137.132.62.172]) by leonis.nus.edu.sg (8.9.3/8.6.9/CNS-3.5) with ESMTP id QAA10808 for ; Tue, 6 Jul 1999 16:17:25 +0800 (SST) Message-ID: <386F78D6.3183FB4@singapore.com> Date: Sun, 02 Jan 2000 16:12:07 +0000 From: thgoh Reply-To: thgoh@singapore.com Organization: thgoh X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 2.2.5-RELEASE i386) X-Accept-Language: zh-CN, zh-TW, en MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG Subject: fifo leaves open files descriptor table in /tmp Content-Type: multipart/mixed; boundary="------------77502C31AAB1291D083FBAC1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------77502C31AAB1291D083FBAC1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi I am desperately trying to solve this open file descriptor table full problem. I have 2 processes communicating via fifo. After some time, I will end up with a file table full problem. A fstat reveals lots of open files in the /tmp directory. A ls on /tmp on shows my only fifo file names. Hence I suspect that thess open files are left by the fifo. I am using mfs for my /tmp. Does fifo have a tendency to leave open files descriptors in /tmp? What else could have left open file descriptors in /tmp? Would opening a file such as /tmp/abc leave such a file in /tmp (without closing) when I do a ls? Any help will be greatly appreciated. TH Goh impsdev:/usr/imps/bin>fstat | grep ocrserver root ocrserver 2352 wd /usr 208477 drwxrwxrwx 40960 r root ocrserver 2352 text /usr 207858 -rwxr-xr-x 701149 r root ocrserver 2352 0 / 3705 crw-rw-rw- null r root ocrserver 2352 1 / 3705 crw-rw-rw- null w root ocrserver 2352 2 / 3705 crw-rw-rw- null w root ocrserver 2352 3 /tmp 10 -rw-r--r-- 19 r root ocrserver 2352 4 /tmp 11 -rw-r--r-- 19 r root ocrserver 2352 5 /tmp 12 -rw-r--r-- 19 r root ocrserver 2352 6 /tmp 13 -rw-r--r-- 19 r root ocrserver 2352 7 /tmp 14 -rw-r--r-- 19 r root ocrserver 2352 8 /tmp 15 -rw-r--r-- 19 r root ocrserver 2352 9 /tmp 16 -rw-r--r-- 19 r root ocrserver 2352 10 /tmp 17 -rw-r--r-- 19 r root ocrserver 2352 11 /tmp 18 -rw-r--r-- 19 r root ocrserver 2352 12 /tmp 19 -rw-r--r-- 19 r root ocrserver 2352 13 /tmp 20 -rw-r--r-- 19 r root ocrserver 2352 14 /tmp 21 -rw-r--r-- 19 r root ocrserver 2352 15 /usr 207426 -rw-r--r-- 0 w root ocrserver 2352 16 /usr 207443 -rw-r--r-- 0 w root ocrserver 2352 17 /usr 207445 -rw-r--r-- 0 w root ocrserver 2352 18 /usr 207450 -rw-r--r-- 0 w root ocrserver 2352 19 /usr 207454 -rw-r--r-- 0 w --------------77502C31AAB1291D083FBAC1 Content-Type: text/html; charset=us-ascii; name="19980719.freebsd-questions" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="19980719.freebsd-questions" Content-Base: "http://www.freebsd.org/cgi/getmsg.cgi? fetch=705744+708582+/usr/local/www/ db/text/1998/freebsd-questions/1998 0719.freebsd-questions" Content-Location: "http://www.freebsd.org/cgi/getmsg.cgi? fetch=705744+708582+/usr/local/www/ db/text/1998/freebsd-questions/1998 0719.freebsd-questions" FreeBSD Mail Archives Navigation Bar Top Applications Support Documentation Vendors Search Index Top Top
Date:      Tue, 21 Jul 1998 12:13:50 -0400
From:      Tuan Hoang <tqhoang@mitre.org>
To:        freebsd-questions@FreeBSD.ORG
Cc:        tqhoang@mitre.org
Subject:   no data in named pipes (FIFO's)
Message-ID:  <35B4BE3D.A723D9DB@mitre.org>

Next in thread | Raw E-Mail | Index | Archive | Help

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



www@freebsd.org
--------------77502C31AAB1291D083FBAC1-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message