Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 02 Jan 2000 16:12:07 +0000
From:      thgoh <thgoh@singapore.com>
To:        freebsd-questions@FreeBSD.ORG
Subject:   fifo leaves open files descriptor table in /tmp
Message-ID:  <386F78D6.3183FB4@singapore.com>

next in thread | raw e-mail | index | archive | help
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"

<html>
<head><title>FreeBSD Mail Archives</title>
<meta name="robots" content="nofollow">
</head>
<body text="#000000" bgcolor="#ffffff">
<IMG SRC="../gifs/bar.gif" ALT="Navigation Bar" WIDTH="565" HEIGHT="33" BORDER=0 usemap="#bar">
<map name="bar">
<area shape="rect" coords="1,1,111,31" href="../index.html" ALT="Top">
<area shape="rect" coords="112,11,196,31" href="../ports/index.html" ALT="Applications">
<area shape="rect" coords="196,12,257,33" href="../support.html" ALT="Support">
<area shape="rect" coords="256,12,365,33" href="../docs.html" ALT="Documentation"> 
<area shape="rect" coords="366,13,424,32" href="../commercial/commercial.html" ALT="Vendors">
<area shape="rect" coords="425,16,475,32" href="../search/search.html" ALT="Search">
<area shape="rect" coords="477,16,516,33" href="../search/index-site.html" ALT="Index">
<area shape="rect" coords="516,15,562,33" href="../index.html" ALT="Top">
<area shape="rect" href="../index.html" coords="0,0,564,32" ALT="Top">
</map><pre>
<strong>Date: </strong>     Tue, 21 Jul 1998 12:13:50 -0400
<strong>From: </strong>     Tuan Hoang &lt;tqhoang@mitre.org&gt;
<strong>To: </strong>       freebsd-questions@FreeBSD.ORG
<strong>Cc: </strong>       tqhoang@mitre.org
<strong>Subject: </strong>  no data in named pipes (FIFO's)
<strong>Message-ID: </strong> &lt;<a href="mid.cgi?db=irt&id=35B4BE3D.A723D9DB@mitre.org">35B4BE3D.A723D9DB@mitre.org</a>&gt;
</pre>
<HR NOSHADE>
<a href="mid.cgi?db=irt&id=35B4BE3D.A723D9DB@mitre.org">Next in thread</a>
| <a href="/cgi/getmsg.cgi?fetch=705744+708582+/usr/local/www/db/text/1998/freebsd-questions/19980719.freebsd-questions+raw">Raw E-Mail</a>
| <a href="/mail/archive/1998/freebsd-questions/19980719.freebsd-questions.html">Index</a>
| <a href="/cgi/getmsg.cgi?fetch=705744+708582+/usr/local/www/db/text/1998/freebsd-questions/19980719.freebsd-questions+archive">Archive</a>
| <a href="../search/searchhints.html">Help</a>
<HR NOSHADE>
<p><pre>
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


</pre>
<hr><address><a href="../mailto.html">www@freebsd.org</a><br></address>
</BODY></HTML>

--------------77502C31AAB1291D083FBAC1--



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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?386F78D6.3183FB4>