Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!usc!bbn.com!fkittred From: fkittred@bbn.com (Fletcher Kittredge) Newsgroups: comp.unix.ultrix Subject: Re: select() on named pipes Message-ID: <55729@bbn.BBN.COM> Date: 4 May 90 11:37:11 GMT References: <9731@wiley.UUCP> Sender: news@bbn.com Reply-To: fkittred@spca.bbn.com (Fletcher Kittredge) Organization: Bolt Beranek and Newman Inc., Cambridge MA Lines: 36 In article <9731@wiley.UUCP> rudoff@mdi.com writes: ...Problems with select on a 3100... >main() >{ ... > n = select(1, &readfds, NULL, NULL, &timeout); ... >} > ..it doesn't work for him... Your problem is your first argument to select; you have hardcoded it to '1' when it should be variable. It should always be one greater than the largest file descriptor you are interested in. In this case, it should be (readfds + 1). >I have select() working elsewhere with stdin so I think I'm using it >correctly. Am I doing something wrong here or is there a problem with >select() and pipes in Ultrix 3.1? It works on stdin because with stdin your readfds is 0, so (readfds + 1) is 1.... > >Doug Rudoff >Mobile Data International >(206) 487-5937 >uunet!mdisea!rudoff, rudoff@MDI.COM Fletcher E. Kittredge fkittred@bbn.com Platforms and Tools Group BBN Software Products Company 10 Fawcett St. Cambridge, MA. 02138