select() on named pipes

Fletcher Kittredge fkittred at bbn.com
Fri May 4 21:37:11 AEST 1990


In article <9731 at wiley.UUCP> rudoff at 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 at MDI.COM



Fletcher E. Kittredge  fkittred at bbn.com
Platforms and Tools Group
BBN Software Products Company
10 Fawcett St.
Cambridge, MA. 02138



More information about the Comp.unix.ultrix mailing list