Article View: mod.computers.ridge
Article #55bug in named pipes/open() under ROS 3.3u3
From: Bill Bogstad
Date: Tue, 11 Nov 1986 04:51
Date: Tue, 11 Nov 1986 04:51
59 lines
2247 bytes
2247 bytes
Description:
There is a bug in the ROS 3.3u3 implementation of named pipes
(fifos). According to the manual page for the open() system call, a
O_WRONLY (write-only) open of a fifo will delay returning until another
process opens the fifo for reading. Under ROS, however, the open
returns immediately.
Repeat-by:
Compile the following program on another System V machine. (I used
a 3B20 running S5R2.) Invoke it the first time with a single argument,
which will create the fifo "foobar" in the current directory. Invoke it
a second time with no arguments. The process will hang because no
process has the fifo open for reading. Use your interrupt character to
break out of the program. If you do the same thing under ROS 3.3u3 the
program returns immediately.
Fix:
Unfortunately, I don't have any ROS sources so I can't suggest a
fix. All you can do for now is try to work around it until Ridge
distributes a fix.
Bill Bogstad
bogstad@hopkins-eecs-bravo.arpa
---CUT HERE---
/* Nov. 1986 - William Bogstad - Demonstrate bug in fifos under ROS 3.3u3 */
#include <fcntl.h>
#include <string.h>
#include <stdio.h>
main (argc, argv)
int argc;
char *argv[];
{
int in_pipe;
char *in_fn = "foobar";
if (argc == 2) {
mknod (in_fn, 010666, 0);
fprintf (stderr, "%s: made\n", in_fn);
exit (0);
}
if ((in_pipe = open (in_fn, O_WRONLY)) >= 0) {
perror(in_fn);
fprintf (stderr, "they were waiting\n");
} else {
perror (in_fn);
fprintf (stderr, "they weren't waiting\n");
}
exit (0);
}
Technical Details
Message-ID:
<8611110456.AA13056@ucbvax.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!lll-lcc!unisoft!dual!ucbvax!HOPKINS-EECS-BRAVO.ARPA!bogstadShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!lll-lcc!unisoft!dual!ucbvax!HOPKINS-EECS-BRAVO.ARPA!bogstad From: bogstad@HOPKINS-EECS-BRAVO.ARPA (Bill Bogstad) Newsgroups: mod.computers.ridge Subject: bug in named pipes/open() under ROS 3.3u3 Message-ID: <8611110456.AA13056@ucbvax.Berkeley.EDU> Date: Mon, 10-Nov-86 23:51:57 EST Article-I.D.: ucbvax.8611110456.AA13056 Posted: Mon Nov 10 23:51:57 1986 Date-Received: Tue, 11-Nov-86 07:20:22 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 59 Approved: info-ridge@hopkins-eecs-bravo.arpa