home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!jvnc.net!netnews.upenn.edu!saul.cis.upenn.edu
- From: freeman@saul.cis.upenn.edu (Jon Freeman)
- Newsgroups: comp.sys.hp
- Subject: read() not blocking on empty stdin in 8.07
- Message-ID: <86042@netnews.upenn.edu>
- Date: 13 Aug 92 00:37:42 GMT
- Sender: news@netnews.upenn.edu
- Organization: University of Pennsylvania
- Lines: 25
- Nntp-Posting-Host: saul.cis.upenn.edu
-
- One of our large programs (written in APL) starts up another process
- (written in C) and opens up a pipe through which the two programs
- communicate; the APL process sends the desired operation + arguments
- and the C process sends back the result. (We do this because most C
- programs are faster than their APL counterparts, of course). The C
- processes communicate using a set of interface routines which the APL
- vendor provides, and we have the source code to those routines. They
- work on all of our other platforms, but...
-
- The C process spends most of its time waiting for input from the APL
- process, naturally. It calls read() on stdin, which should block if
- there's nothing in the pipe. Instead of blocking, however, read()
- *sometimes* returns immediately with a value of 0. The man page for
- read() says that this is correct behavior when certain flags are set
- for the file descriptor in question, but I don't know if those flags
- are set for stdin. Is HP-UX's read() supposed to block on stdin if
- it's empty? If so, has anyone else experienced this problem?
-
- Thanks in advance,
- Jon
-
- -------------------------------------------------------------------------------
- All life is suffering. | Jon Freeman
- The cause of suffering is desire. | freeman@gradient.cis.upenn.edu
- I want my MTV. | Office: (215) 898-4612
-