From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,acba8b4598523cd9,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-07-06 05:30:53 PST Path: bga.com!news.sprintlink.net!hookup!yeshua.marcam.com!news.kei.com!eff!news.umbc.edu!cs.umd.edu!not-for-mail From: mdtanx@cs.umd.edu (Michael D. Tan) Newsgroups: comp.unix.osf.osf1 Subject: BUG[?]: select() for reading from unattached FIFO Date: 6 Jul 1994 08:27:15 -0400 Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Distribution: world Message-ID: <2ve7v3$fap@poptart.cs.umd.edu> NNTP-Posting-Host: poptart.cs.umd.edu Can anyone else confirm this bug? I have a FIFO which I have opened for reading on one side using O_RDONLY | O_NDELAY. No writers are attached to the FIFO yet. When I do a select() for reading on this FIFO, select() returns that the FIFO is ready for reading, but a read() returns nothing (correctly). In SunOS, select() *doesn't* say the FIFO is readable, but my same test program in OSF/1 v2.0 says it is. This is a bug, isn't it? Thanks. Michael Tan mdtanx@cs.umd.edu Here's the test program: #include #include #include #include #include #include #include #include main() { int fd,; fd_set readfds; unlink("AFIFO"); mkfifo("AFIFO", 0660); if ((fd = open("AFIFO", O_RDONLY | O_NDELAY)) < 0) { printf("open for workin failed\n"); exit (-1); } FD_ZERO(&readfds); FD_SET(fd, &readfds); select(fd+1, &readfds, NULL, NULL, NULL); if (FD_ISSET(fd, &readfds)) { char ss[200]; int amt; ss[0] = '\0'; printf("fd was set\n"); if ((amt = read(fd, ss, 200)) < 0) printf("read error %d\n", errno); printf("Read %d bytes: %s\n", amt, ss); } }