Thread View: mod.computers.ridge
1 messages
1 total messages
Started by Bill Bogstad
Tue, 11 Nov 1986 04:51
bug in named pipes/open() under ROS 3.3u3
Author: 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);
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads