/*++ /* NAME /* fifo_rdonly_bug 1 /* SUMMARY /* fifo server test program /* SYNOPSIS /* fifo_rdonly_bug /* DESCRIPTION /* fifo_rdonly_bug creates a FIFO and opens it read only. It /* then opens the FIFO for writing, writes one byte, and closes /* the writing end. On Linux Redhat 4.2 and 5.0, and HP-UX 9.05 /* and 10.20, select() will report that the FIFO remains readable /* even after multiple read operations. /* DIAGNOSTICS /* Problems are reported to the standard error stream. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA
/*--*/
printf("Write one byte to the fifo, then close it...\n"); if ((fd2 = open(FIFO_PATH, O_WRONLY, 0)) < 0)
perrorcleanup("open fifo O_WRONLY"); if (write(fd2, "", 1) < 1)
perrorcleanup("write one byte to fifo"); if (close(fd2) < 0)
perrorcleanup("close fifo");
printf("Selecting the fifo for readability...\n");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.